mapbox-developer-group / Mapbox-Tech-Q-A

在提问之前请自行查看文档哦,养成好习惯:https://docs.mapbox.com/
32 stars 1 forks source link

在unity中怎么显示鼠标所在位置的经纬度 #53

Open eddywen opened 4 years ago

eddywen commented 4 years ago

@llliao104 在如何显示起点终点的路径 #52 提到的问题

使用AbstractMap提供的方法:

public virtual Vector2d WorldToGeoPosition(Vector3 realworldPoint)
{
    // For quadtree implementation of the map, the map scale needs to be compensated for.
    var scaleFactor = Mathf.Pow(2, (InitialZoom - AbsoluteZoom));
        return (Root.InverseTransformPoint(realworldPoint)).GetGeoPosition(CenterMercator, WorldRelativeScale * scaleFactor);
}