mapbox-gl-js - 根据经度和纬度获取查询RenderedFeatures的Mapbox点
问题描述
我用 Mapbox Geocoding API 找到了一个地址。然后我想在地图上突出显示该建筑物。
它适用于本机,但不适用于网络。我想在 mapBox 视图中为 renderFeatures 找到要点。
像这样的东西
pointInView = await map.getPointInView(foundAddress.center)
foundBuildings = await map.queryRenderedFeaturesAtPoint(pointInView)
如何将 long,lat 转换为 mapbox-gl-js 中的点
更新 发现有用的东西 如何在 Mapbox 中查询最接近地理编码结果的特征?
解决方案
找到了,叫project(LngLat)
pointInView = await map.project(foundAddress.center)
推荐阅读
- c# - 如何从错误 1216-无法添加或更新子行中获得更透明的消息:MySQL 中的外键约束失败?
- php - htaccess 重定向在实时站点中不起作用
- flutter - Flutter - 如何同步两个或多个 PageController
- c++ - rs2_device_info 详细定义在哪里?
- python - 检测到带有 Chromedriver 的 Python Selenium
- jupyterhub - pre-commit run 路径python3.6(来自--python=python3.6)不存在
- c# - VS2019 IDE 和命令行编译器在 C# 语句上存在分歧
- reactjs - CSS在推送到网站时不显示,但在本地主机上显示 - ReactJS / Gatsby
- java - Android NavigationComponent:导航抽屉没有反应
- robotframework - 如何识别一个值是整数还是数字?