简体   繁体   English

使用 mapbox 进行坐标转换

[英]Coordinates conversion with mapbox

Does mapbox support coordinates only in the following format, as numbers? mapbox 是否仅支持以下格式的坐标,作为数字? [-58.5003038, -34.5741957]

My coordinates are saved in the DB as this format of number and direction 1010N 09710W and if I put them directly on the map, I get Error: Invalid LngLat object: (NaN, NaN)我的坐标以数字和方向1010N 09710W的格式保存在数据库中,如果我将它们直接放在 map 上,我会收到Error: Invalid LngLat object: (NaN, NaN)

How can I convert them to some format that mapbox supports?如何将它们转换为 mapbox 支持的某种格式?

I am using Mapbox GL JS and VueMapbox that is basically mapboxGL JS for Vue我正在使用 Mapbox GL JS 和VueMapbox ,这基本上是 Vue 的 mapboxGL JS

Thank you谢谢

Yes, Mapbox only supports coordinates as decimal degrees.是的,Mapbox 只支持十进制度的坐标。 Your coordinates are likely in some other projection (which you will need to figure out), and you will need to convert them with something like proj4js.您的坐标可能在其他一些投影中(您需要弄清楚),您需要使用 proj4js 之类的东西来转换它们。 You might try asking on gis.stackexchange.com.您可以尝试询问 gis.stackexchange.com。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM