ajax - Bing maps get geolocation between two places failes -


I use autocomplete for two text boxes, it works fine using this code:

  $ ('[id $ = placeOfDeparture]: no (.ui-autocomplete-input), [id $ = PlaceOfArrival]: no (.ui-autocomplete (' focus', function) {$ (This). Autocomplete ({source: function (request, response) {$ .ajax ({url: "http://dev.virtualearth.net (key: 'mykey', q: request.term}, jsonp : "Jsonp", success: function (data) {var results = data. Source resource [0]; if (result) {if (result. Estimated total = 0) {reverse Or ($ .max (result. Source, work (item) {return {data: item, label: item.Name + '(' + item.address.countryRegion + ')', value: item.name};}) );}}}}}}, Select minnamban: 1,: function (event, UI) {$ (this) .val (ui.item.value); travel = $ (this) .clostest ('div (); $ (This) .change (); updateMap ();}, open: work () {$ (this) .removeClass ("ui-corner-all") AddClass ("ui- Corner-top ");}, close: function () {$ (this) .removeClass (" ui-corner-top ") AddClass ("ui-corner-all"); }}); });  

});

It works fine then I want to draw a line between the places of the map.

  bingMap = new Microsoft.Maps.Map (document.getElementById ("map_canvas"), {credentials: "mikey", map type iid: Microsoft.maps.MapTypeId.auto, enableSearchLogo: false , EnableClickableLogo: false, show dashboard: false, center: new Microsoft map. Location (55.7, 13.1833333), zoom: 10}); Microsoft.Maps.loadModule ("Microsoft.Maps.Directions", {Callback: Guideline Modules Loaded});  

I use it to set the path point in the Bing map:

  var startwaypoint = new Microsoft.maps.Directions.Waypoint ({address : PlaceOfDeparture}); BingDirections.addWaypoint (startwaypoint); // and var endpoint = new Microsoft.maps direction. Yipoint ({address: placeoffairgare}); BingDirections.addWaypoint (endwaypoint); // Calculate the instructions, which displays a route on the map bingDirections.calculateDirections;  

The first two ajaxpost works just fine and gives me the "status code": 200 which I have read is considered good :) But then when I bingDirections.calculateDirections (); Microsoft Maps NetworkCallback ({"Resolved Weveent": [[{"Failed": True, "Invalid Credentials": Incorrect, "Input Type": 0, "Latitude": 0, "Longitude": 0, "rooftopLatitude" False, "inputType": 0, "Latitude": 0, "rooftopLongitude": 0, "address": null, "multiple choice": null, "locationIdentifier": null}, {"failed": true, "invalidCredentials" "," Longitude ": 0," Roopoplatidoid ": 0," Roofoplongidue ": 0," Address ": blank," nonconformity ": zero," location identifier ": zero}]]}, 'd6392');

Check the response header, may be an asset named X-MS-BM-WS-INO. This will indicate that your request rate was limited. If you make a lot of requests using a basic key (non-enterprise / licensed account) and your account is generated from the transaction-generating rate that is more than the free words used, then your account's Rate is limited, the result is coming back empty. It is done to ensure that basic accounts do not affect the service for enterprise users. Note that autocomplete is not within the terms of use and it is likely that due to free usage conditions, the rate of transaction is the reason.

See also this documentation:


Comments