Mapbox: Get loaded tile coordinates? [closed]

☆樱花仙子☆ 提交于 2020-01-14 04:15:09

问题


I'd like to load 3D terrain onto my mapbox map, like Peter's example, however I'm hoping to find a much simpler implementation. My idea is to use mapbox's data event to get each loaded tile and simply load a three.js mesh above it.. but I need to figure out how to calculate each tile's lng/lat in order for this to work.

The data event does return a tile object (for each loaded tile) with lots of information, however, I am completely new to geospatial data and would appreciate any hints on how to get the coordinates. My guess is to use the tiles posMatrix property (a float32 array) to convert it but I'm really just grasping at straws here :)

Below are the libraries I'm using: - React - Threebox - MapboxGL

Thanks


回答1:


Try https://github.com/mapbox/tilebelt. Specifically tilebelt.tileToBBOX will give you the lng/lat bounds of an z/y/x tile.



来源:https://stackoverflow.com/questions/50245182/mapbox-get-loaded-tile-coordinates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!