我正在紧跟示例at this link at Mapbox documentation来向多边形添加模式。我只需使用onClick事件获取他们的代码并将其添加到我的地图中。这是非常简单和基本的。以下是我的工作代码:(它是从Mapbox教程中复制/粘贴的,但这是我实际工作的代码) function test() {
map.addSource('source', {
"type": "geojson&q
我尝试将一个本地文件加载到MapBox,得到错误消息:来自ajax函数的ERROR parsererror No conversion from text to geojson和用于evented.js文件,http://geojson.io加载它没有任何错误,我想这是关于我的Ajax请求的。family=Open+Sans" rel="stylesheet">
<script src='https://api.tiles.
mapbox-gl.js:35 Uncaught Error: The type property must be defined, but only the following propertiesat i.addSource (mapbox-gl.js:35) at r.<anonymous> (DynamicRoute.jsx:8)