Topic: about DistanceAndDurationExample question

Hello~
I want to use DistanceAndDurationExample to calculate the distance between two points
when I use example data
set:

private void Start()
        {
            if (string.IsNullOrEmpty(googleAPIKey)) Debug.LogWarning("Please specify Google API Key");

            // Find route using Google Directions API
            OnlineMapsGoogleDirections request = new OnlineMapsGoogleDirections(googleAPIKey, "Los Angeles", new Vector2(-118.178960f, 35.063995f));
            request.OnComplete += OnGoogleDirectionsComplete;
            request.Send();
        }

that is Work.

but when I set Taiwan or China map
ex:

private void Start()
        {
            if (string.IsNullOrEmpty(googleAPIKey)) Debug.LogWarning("Please specify Google API Key");
           
            // Find route using Google Directions API
            OnlineMapsGoogleDirections request = new OnlineMapsGoogleDirections(googleAPIKey, new Vector2(25.49756f, 118.67244f), new Vector2(26.65204f, 117.87108f));
            request.OnComplete += OnGoogleDirectionsComplete;
            request.Send();
        }

this is no work.
see this screenshot:

https://www.dropbox.com/s/5gxw8xgx4la3w … 4.jpg?dl=0

Please help me to adjust it.
thx ><

Re: about DistanceAndDurationExample question

Hello.

When you use coordinates as Vector2: X is longitude, Y is latitude.
When you use coordinates as double: first longitude, then latitude.

You are simply confused the latitude and longitude in Vector2.

Kind Regards,
Infinity Code Team.

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

Re: about DistanceAndDurationExample question

It is work.
Thanks for your help ><