【发布时间】:2021-05-30 13:04:16
【问题描述】:
我正在使用 mapbox gl js 构建网络地图,一切正常,但现在不知从何而来我收到此错误:
错误 {消息:“无法读取未定义的属性‘0’”}
虽然它在一天前工作并且代码没有任何变化:
var url = 'http://localhost:3000/data';
map.addSource('features', {
type: 'geojson',
data: url
});
map.addLayer({
'id': 'features-layer',
'type': 'circle',
'source': 'features',
'paint': {
'circle-color': '#ccc',
'circle-radius': 10,
'circle-opacity': 0.6,
'circle-stroke-width': 0.6,
'circle-stroke-color': 'black',
}
});
【问题讨论】:
-
你找到解决这个问题的方法了吗?
标签: javascript mapbox