1 (edited by gwhitch 2021-05-27 19:57:01)

Topic: OnlineMapsOpenRouteServiceDirections

Do I have to do something specific on my Android device? When I ask for the same address when using the OnlineMapsOpenRouteServiceDirections, the result returned on the Android is different than the result returned when it runs in the editor on the PC.

This is the function call

OnlineMapsOpenRouteServiceDirections.Find(
                  new double[]
                  {
                       // Coordinates
                       lng, lat,
                      // Result.features[0].geometry.coordinates[0], Result.features[0].geometry.coordinates[1]
                      targetLng,targetLat
                  },
                  new OnlineMapsOpenRouteServiceDirections.Params
                  {
                      // Extra params
                      language = "en",
                      profile = OnlineMapsOpenRouteServiceDirections.Profile.drivingCar,
                      units = "mi"
                  }).OnComplete += OnRequestComplete;
        if (targetMarker == null)
        {
            targetMarker = OnlineMapsMarker3DManager.CreateItem(Result.features[0].geometry.coordinates[1], Result.features[0].geometry.coordinates[0], targetPrefab);
            targetMarker.scale = targetScale;
        }
        else targetMarker.SetPosition(targetLng, targetLat);

    }

private void OnRequestComplete(string response)
    {
response =  "HTTP/1.1 400 Bad Request."  (on Android)

response = {"routes":[{"summary":{"distance":30.137,"duration":2435.5},"segments":[{"distance":30.137...... (on PC:)
     

...
...
...
    }

Re: OnlineMapsOpenRouteServiceDirections

Hello.

Are you using the same coordinates on PC and Android?

Also, please attach the url of the requests you have on PC and Android. I will check it.
These urls do not need to contain the coordinates that you will be using in production.
But, it must be the urls you are having this problem with.

Kind Regards,
Infinity Code Team.

uContext is Editor PowerPack (more than 50 tools) that take your workflow in Unity Editor to a next level, simplifies working with content, adds new features, corrects and improves the editor’s built-in behaviors. Click here to download uContext Basic for free.

Re: OnlineMapsOpenRouteServiceDirections

Thanks for pointing me to the right direction. The device for was giving me a 0,0 due to an error for my location and that was causing an issue.