1 (edited by ChrisH 2016-11-17 14:24:58)

Topic: LookToCoordinates

Hi,
I am tried to use the LookToCoordinates method to turn a 3D marker to a certain GPS-Position.
Nothing happens and when I look at the implementation it is empty.
What I now tried is to turn it by hand but could not find any method to translate GPS to unity position.

Any solution?

Best Regards,
Chris

Re: LookToCoordinates

Hello.

To convert geographic coordinates to Unity World Position use OnlineMapsTileSetControl.GetWorldPosition.
http://infinity-code.com/doxygen/online … 2992c6e097

About LookToCoordinates:
Oops. It should be:

public override void LookToCoordinates(Vector2 coordinates)
{
    double p1x, p1y, p2x, p2y;
    map.projection.CoordinatesToTile(coordinates.x, coordinates.y, 20, out p1x, out p1y);
    map.projection.CoordinatesToTile(longitude, latitude, 20, out p2x, out p2y);
    rotation = Quaternion.Euler(0, (float)(OnlineMapsUtils.Angle2D(p1x, p1y, p2x, p2y) - 90), 0);
}

The next version will contain this code.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.