根据经纬度获取queryRenderedFeatures的Mapbox点
Get Mapbox point for queryRenderedFeatures based on longitude and latitude
我用 Mapbox 地理编码找到了一个地址 API。然后我想在地图上突出显示该建筑物。
它在本机中有效,但在网络中无效。我想在 mapBox 视图中找到 renderedFeatures 的点。
像这样
pointInView = await map.getPointInView(foundAddress.center)
foundBuildings = await map.queryRenderedFeaturesAtPoint(pointInView)
如何将 long,lat 转换为 mapbox-gl-js 中的 a 点
更新
发现有用的东西
找到了,叫做项目(LngLat)
pointInView = await map.project(foundAddress.center)
我用 Mapbox 地理编码找到了一个地址 API。然后我想在地图上突出显示该建筑物。
它在本机中有效,但在网络中无效。我想在 mapBox 视图中找到 renderedFeatures 的点。
像这样
pointInView = await map.getPointInView(foundAddress.center)
foundBuildings = await map.queryRenderedFeaturesAtPoint(pointInView)
如何将 long,lat 转换为 mapbox-gl-js 中的 a 点
更新
发现有用的东西
找到了,叫做项目(LngLat)
pointInView = await map.project(foundAddress.center)