none
REST Calls are being made successfully, but the return

    Question

  • I'm using the DOJO library to make Ajax calls to the

    BING elevation service. The calls are being made successfully,

    200 error, but the functions seem to break. I've tested this by

    making calls to a non BING service and JSON data was

    returned with out problem. But when calling the BING service

    get this error an error in the console, which points to a

    returned sheet from the BING service.

    " Uncaught SyntaxError: Unexpected token : "

    The sheet is always listed as 'Polyline: 1', screenshot lised below.

    Any help would be great

    code snippet

    request.get('https://dev.virtualearth.net/REST/v1/Elevation/Polyline?points=-84.44627894973615, 33.79093896172691, -84.43705215072468, 33.80377767236137&heights=sealevel&samples=10&key=BINGKEY', { jsonp: 'callback'
    }).then(function(returned) {
    	console.log('call has completed: ' + returned);
    }).error(function(msg) {
    	console.log('there was a problem retrieving elevation data: ' + msg);
    });

    Problem file is on the left portion of the screen, highlighted for ease



    • Edited by ATLMapper Friday, April 04, 2014 5:18 PM
    Friday, April 04, 2014 4:41 PM

Answers

All replies

  • This is not an issue with Bing Maps. The service you are calling only returns a JSON response and no additional sheets. The error is somewhere in the code you are using as toLowerCase is never in any of the responses from the service.

    http://rbrundritt.wordpress.com

    Saturday, April 05, 2014 10:41 AM
  • the 'toLowerCase' error is not apart of this function, and not causing the break, but thanks I'll change that portion of the code.
    Saturday, April 05, 2014 11:36 PM