Topic: online maps unity3d zoom problems
Hi,
when using unity3d with online maps, i can add an entity to the map to a certain point, but when i zoom-out or zoom-in the location of the object is changed, and just moving to anouther palce on the map.
when returning to the initial zoom level, the object returns to place.
should i be doing anything special?
my code:
OnlineMaps api = OnlineMaps.instance;
public Vector3 HPosition()
{
float Lat = model.Lat;
float Lng = model.Lng;
float Rad = model.Radius ;
Vector3 position = OnlineMapsTileSetControl.instance.GetWorldPosition(Lng, Lat);
position.y = -0.70f;
return position;
}
public Quaternion HRotation()
{
float heading = 90;
return Quaternion.Euler(0, heading, 0);
}
private void Update()
{
this.transform.rotation = HRotation();
this.transform.position = HPosition();
float k =Mathf.Pow(2,9);
float scale = Mathf.Pow(2, api.zoom)/k;
this.transform.localScale = scale * Vector3.one * model.Radius/15f;
}