none
Route is not calculated on mobile device but it is calculated on Desktop device RRS feed

  • Question

  • Hi,

    in my app I've added a bing map control.

    I've added to it also a key obviously (<small style="box-sizing:border-box;font-size:11.9px;">Key type: </small>Basic / Universal Windows App).

    The app calculates routes for some destinations but the app is able to show the route on the desktop device

    but not on the mobile devices like phone or phone emulator.

    I receive an exception not RouteFound.

    This is my code:

    var routeResultTask = MapRouteFinder.GetDrivingRouteAsync(
                    currentLocation.Geopoint, location.Geopoint,
                    MapRouteOptimization.TimeWithTraffic, MapRouteRestrictions.None);
                var routeResultWithoutTrafficTask = MapRouteFinder.GetDrivingRouteAsync(
                    currentLocation.Geopoint, location.Geopoint,
                    MapRouteOptimization.Time, MapRouteRestrictions.None);

                MapRouteFinderResult routeResult = await routeResultTask;
                MapRouteFinderResult routeResultWithoutTraffic = await routeResultWithoutTrafficTask;
                if (routeResult.Status == MapRouteFinderStatus.Success){

    ....

    }

    But as I wrote above if I execute the app on desktop device the route is calculated.

    What could be the problem?

    Thanks in advanced.

    Regards

    Daniele

    Wednesday, June 7, 2017 3:34 PM

Answers

  • Now I find out the problem.

    In my phone there was the Location service option disabled.

    Now I enable it and the coordinate of the current location is ok.

    Anyway Thanks for you support.

    Regards

    Daniele

    Thursday, June 8, 2017 9:54 AM

All replies

  • Hi Daniele,

    Can you post the coordinates for "currentLocation" & "location" (the waypoints). Do you have internet connectivity on the mobile device?

    Thanks, Florin S.

    Wednesday, June 7, 2017 4:15 PM
  • Here the coordinates

    Current Location {47.6785619, -122.1311156}

    Location {41.7611265, 12.2259561}

    Yes of course,

    I have internet connection on my mobile device.

    Thanks

    Daniele 

    Wednesday, June 7, 2017 8:35 PM
  • First waypoint is in the USA and the second is in Europe. You cannot get a driving route across the Atlantic.

    I'm curious how you got a response on desktop for this particular combination of coordinates?

    Wednesday, June 7, 2017 11:20 PM
  • Yes you're right.

    I didn't realize that the coordinates of the current locations were in USA.

    The problem is that I get wrong coordinates on mobile device.

    On desktop device I get the right current location coordinates :

    Current Location {42.1216468775979, 12.5965755955098}

    and that's why works.

    So now the question is :

    why I'm receiving USA coordinates for the current location even if I'm in Europe?

    and why I've the problem only if the app runs on the mobile devices and not on desktop device?

    Thanks for any help.

    Regards

    Daniele

    Thursday, June 8, 2017 9:40 AM
  • Now I find out the problem.

    In my phone there was the Location service option disabled.

    Now I enable it and the coordinate of the current location is ok.

    Anyway Thanks for you support.

    Regards

    Daniele

    Thursday, June 8, 2017 9:54 AM
  • Yeah, the phone is probably using Redmond as current location if Location Services is disabled.

    Happy to hear you've sorted it out!

    Thursday, June 8, 2017 4:26 PM