【发布时间】:2022-11-16 01:52:42
【问题描述】:
未处理的运行时错误
错误:LngLatLike 参数必须指定为 LngLat 实例、对象 {lng: , lat: }、对象 {lon: , lat: } 或 [, ] 数组
const addToMap = (map,coordinates) => {
32 | const marker1 = new mapboxgl.Marker()
> 33 | .setLngLat(coordinates)
| ^
34 | .addTo(map)
35 | }
回答 并立即提供帮助
【问题讨论】:
-
告诉我们什么是
coordinates -
这回答了你的问题了吗? Fitting map bounds to raster layer
-
我通过道具得到坐标
标签: reactjs