none
latitude and longitude coordinates in Rest fo routes using JS does not get route data RRS feed

  • Question

  • Hi ,

    I m trying to get rout distance through Bing REST using JAVA Script. However when I enter Lat and Log in routeRequest Url it done not get anything.. But if I enter the address it works not sure what i'm done wrong.

    I did try multiple string combination for the Lat and Lot value no luck.. Part 1 does not work part 2 works.

    Here is my code in JavaScript

    any help will be appricated.

    stev

    var start= 'Oakville, On';
    var end= 'Toronto, On';
    startLat= "43.465678";
    var lcomma=",";
    startLog="-79.689331";
    endLat='43.653226'
    endLog='-79.383184';  
    map.getCredentials(callRouteService); 
    function callRouteService(credentials)
    {

    This does not works ?? Part 1

    start=startLat+lcomma+startLog;
    end = endLat+lcomma+endLog;

    var routeRequest = 'https://dev.virtualearth.net/REST/v1/Routes?wp.0=' + start +
       '&wp.1=' + end + '&routePathOutput=Points&output=json&jsonp=routeCallback&key=' + credentials;

    }

    // This code works Part 2

    var routeRequest = 'https://dev.virtualearth.net/REST/v1/Routes?wp.0=' +start+'&wp.1='+ end +
    '&routePathOutput=Points&output=json&jsonp=routeCallback&key=' + credentials;

      

    Wednesday, June 29, 2016 4:25 PM

Answers

  • Both are working for me. In your browser press F12 and click on the network tab. Then make the request and see if it fails with any errors or not.

    [Blog] [twitter] [LinkedIn]

    • Proposed as answer by Ricky_Brundritt Wednesday, June 29, 2016 5:10 PM
    • Marked as answer by Steven1968 Tuesday, July 5, 2016 3:01 PM
    Wednesday, June 29, 2016 5:09 PM
  • Thanks Ricky..

    Reboot the system and tried again it all worked not sure what was causing the issue may be a cash issue..

    Thanks

    • Marked as answer by Steven1968 Tuesday, July 5, 2016 3:02 PM
    Tuesday, July 5, 2016 3:02 PM

All replies

  • Both are working for me. In your browser press F12 and click on the network tab. Then make the request and see if it fails with any errors or not.

    [Blog] [twitter] [LinkedIn]

    • Proposed as answer by Ricky_Brundritt Wednesday, June 29, 2016 5:10 PM
    • Marked as answer by Steven1968 Tuesday, July 5, 2016 3:01 PM
    Wednesday, June 29, 2016 5:09 PM
  • Thanks Ricky..

    Reboot the system and tried again it all worked not sure what was causing the issue may be a cash issue..

    Thanks

    • Marked as answer by Steven1968 Tuesday, July 5, 2016 3:02 PM
    Tuesday, July 5, 2016 3:02 PM