Topic: Elevation is wrong
Hello,
I should put some Gameobjects at real positions, longitude, latitude and altitude (in meters).
To do this, I'm using your suggested code:
public static Vector3 GetWorldPositionWithAltitude(double longitude, double latitude, float elevation)
{
double tlx, tly, brx, bry;
OnlineMaps.instance.GetCorners(out tlx, out tly, out brx, out bry);
Vector3 p = OnlineMapsTileSetControl.instance.GetWorldPositionWithElevation(longitude, latitude, tlx, tly, brx, bry);
float el = OnlineMapsElevationManagerBase.GetUnscaledElevation(longitude, latitude, tlx, tly, brx, bry);
float yOff = elevation - el;
yOff *= OnlineMapsElevationManagerBase.GetBestElevationYScale(tlx, tly, brx, bry);
yOff *= OnlineMaps.instance.transform.localScale.x;
p.y += yOff;
return p;
}
Unfortunately the Gameobjects seem to be placed at a wrong height: someone is more or less right (on the surface), but most of them are a lot under or over the surface.
I've tried with Mapbox, ArcGis and Bing elevation, but with all of them I get the same result.
I'd be glad for your help!
Thanks!