【发布时间】:2020-12-22 02:31:33
【问题描述】:
我在 Mapbox 中有一张州地图,每个选区都是一个单独的特征。我想根据政党投票之间的差异来改变每个选区的颜色。 Here's an example of what I'm trying to achieve 与 what I have right now。
我尝试使用 map.setPaintProperty,但是设置一个功能会强制您更改与 ID 不匹配的所有其他功能。
map.setPaintProperty("wisconsin", "fill-color",
["match",["get", "id"],
features[i].properties["OBJECTID"],
color, "#ffffff"
]
);
我该怎么做?或者有其他方法吗?
【问题讨论】:
标签: javascript geojson mapbox-gl-js