I followed your advice, and it's almost working.
The problem i had by following your instruction was:
When using zoom, the localposition of the gameobject (child of the marker prefab) does'nt change.
So i attached a script to this gameobject, which suscribe to the "OnMapZoom" event, in order to set the correct transform.localposition.y value.
tileSetControl.OnMapZoom += updateAltitude;
tileSetControl.OnSmoothZoomProcess += updateAltitude;
private void updateAltitude()
{
float alt = 0.001f * altitude *tileSetControl.GetElevationValue(lng, lat, tileSetControl.GetBestElevationYScale(api.topLeftPosition, api.bottomRightPosition), api.topLeftPosition, api.bottomRightPosition);
transform.localPosition = new Vector3(0, altitude, 0);
}
And it is working ! But now, if i destroy my markers by calling
"OnlineMapsControlBase3D.instance.RemoveMarkers3DByTag("Waypoint");"
(at this point the waypoints seems to be removed correctly)
And then if i try to change the zoom level, the current error appear:
MissingReferenceException: The object of type 'Waypoint' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
Waypoint.updateAltitude () (at Assets/Waypoint.cs:29)
OnlineMapsControlBase.ZoomOnPoint (Int32 zoomOffset, Vector2 screenPosition) (at Assets/Infinity Code/Online maps/Scripts/Controls/OnlineMapsControlBase.cs:992)
OnlineMapsControlBase.UpdateZoom () (at Assets/Infinity Code/Online maps/Scripts/Controls/OnlineMapsControlBase.cs:926)
OnlineMapsControlBase.Update () (at Assets/Infinity Code/Online maps/Scripts/Controls/OnlineMapsControlBase.cs:781)
The line causing the error is
transform.localPosition = new Vector3(0, altitude, 0);
So it look like the script of the marker prefab child is still existing somewhere after the destruction of the marker.
I though that setting a relative altitude would be an easy task, but the more i try the more problems i meet