I'm here because I'm trying to create a GTA V map with Leafletjs API. In deed, I've got my tiles that are ready. But the aim is to put markers on the map by using GTA V in-game coordinates. To achieve it, I need to convert the coordinates to LatLong but after many researches, I can't find a solution.
我在这里是因为我正在尝试使用Leafletjs API创建GTA V地图。事实上,我已经准备好了我的瓷砖。但目的是通过使用GTA V游戏中的坐标将标记放在地图上。为了实现它,我需要将坐标转换为LatLong,但经过多次研究后,我找不到解决方案。
示例:提前致谢。
3 个解决方案
#1
3
Your coordinates are coming from different map projections. The Leaflet ones are most probably standard WGS 84 (SRID 4326). GTA V coordinates are obviously based on a different projection.
您的坐标来自不同的地图投影。 Leaflet很可能是标准的WGS 84(SRID 4326)。 GTA V坐标显然基于不同的投影。
Coordinates can be transformed from one projection to anothers. But you need to know, which projection your coordinates are coming from, to do the math. Here is an online converter provided with some common projections, and i tried your coordinates, but had no luck in coming close with these projections.
坐标可以从一个投影转换为另一个投影。但是你需要知道你的坐标来自哪个投影来进行数学运算。这是一个在线转换器提供了一些常见的投影,我尝试了你的坐标,但没有运气接近这些预测。
#2
1
I tried this:
我试过这个:
var latlng = new L.latLng(-43.1731, 6.6906);
var point = L.Projection.Mercator.project(latlng);
console.log(point);
// o.Point {x: 744794.1851014761, y: -5309112.129212381}
It is not close to your GTA V coordinates, but I'm not sure it were just for example.
它不接近你的GTA V坐标,但我不确定它只是例如。
#3
0
You can use L.latlng
function
你可以使用L.latlng功能
http://leafletjs.com/reference.html#latlng
http://leafletjs.com/reference.html#latlng
#1
3
Your coordinates are coming from different map projections. The Leaflet ones are most probably standard WGS 84 (SRID 4326). GTA V coordinates are obviously based on a different projection.
您的坐标来自不同的地图投影。 Leaflet很可能是标准的WGS 84(SRID 4326)。 GTA V坐标显然基于不同的投影。
Coordinates can be transformed from one projection to anothers. But you need to know, which projection your coordinates are coming from, to do the math. Here is an online converter provided with some common projections, and i tried your coordinates, but had no luck in coming close with these projections.
坐标可以从一个投影转换为另一个投影。但是你需要知道你的坐标来自哪个投影来进行数学运算。这是一个在线转换器提供了一些常见的投影,我尝试了你的坐标,但没有运气接近这些预测。
#2
1
I tried this:
我试过这个:
var latlng = new L.latLng(-43.1731, 6.6906);
var point = L.Projection.Mercator.project(latlng);
console.log(point);
// o.Point {x: 744794.1851014761, y: -5309112.129212381}
It is not close to your GTA V coordinates, but I'm not sure it were just for example.
它不接近你的GTA V坐标,但我不确定它只是例如。
#3
0
You can use L.latlng
function
你可以使用L.latlng功能
http://leafletjs.com/reference.html#latlng
http://leafletjs.com/reference.html#latlng