我使用这种方法,但结果是精确匹配,不能模糊匹配
map.setPaintProperty('building_layeres', 'fill-extrusion-color', [
'case',
['==', ['get', 'NAME'], '腾讯大厦'],
'red',
['==', ['get', 'NAME'], '彩讯科技大厦'],
'red',
'#aaa',])发布于 2019-05-30 09:39:54
Mapbox-GL只支持非常小范围的字符串操作运算符,不包括正则表达式或其他形式的通配符。
你可以在这里看到它们:https://docs.mapbox.com/mapbox-gl-js/style-spec/#expressions-string
https://stackoverflow.com/questions/56354289
复制相似问题