We have slightly improved this method.
Now this should work better for you.
The next version will contain this.
OnlineMapsSpriteRendererControl.GetScreenPosition:
public override Vector2 GetScreenPosition(double lng, double lat)
{
double tlx, tly, brx, bry;
map.GetTileCorners(out tlx, out tly, out brx, out bry);
int maxX = 1 << map.zoom;
if (tlx > brx) brx += maxX;
double px, py;
map.projection.CoordinatesToTile(lng, lat, map.zoom, out px, out py);
if (px + maxX / 2 < tlx) px += maxX;
double rx = (px - tlx) / (brx - tlx) - 0.5;
double ry = 0.5 - (py - tly) / (bry - tly);
Bounds bounds = spriteRenderer.sprite.bounds;
Vector3 size = bounds.size;
rx *= size.x;
ry *= size.y;
Vector3 worldPoint = transform.localToWorldMatrix.MultiplyPoint(new Vector3((float)rx, (float)ry, bounds.center.z));
return Camera.main.WorldToScreenPoint(worldPoint);
}
Kind Regards,
Infinity Code Team.
Boost your productivity a lot and immediately using
Ultimate Editor Enhancer.
Trial and non-commerce versions available.