【发布时间】:2019-09-11 02:02:33
【问题描述】:
我是 mapbox 的新手。我必须像下面的例子那样填充图表
https://docs.mapbox.com/mapbox-gl-js/example/updating-choropleth/
我使用 geojson 文件作为源,但它不起作用。
map.on('load', function() {
map.addSource('tls_demand', {
'type': 'geojson',
'url': 'http://1xx.2xx.1xx.1xx/xxxx.geojson'
});
map.addLayer({
"id": "tls_projection",
"type": "fill",
"source": "tls_demand",
"filter": ["==", "$type", "MultiPolygon"],
'paint': {
"line-color": "red",
'fill-opacity': 0.75
}
});
});
有人可以建议怎么做吗?
【问题讨论】: