Reverse Geocoding using Bing Map in Windows 8 JavaScript (WinJS) Example

Here is an example of using Bing Map Api to reverse geocode a longitude and latitude to get an address.  I used this while building a Windows 8 JavaScript app. I started off using Google map api but I could not get pass the undefined ‘google’ issue so this a nice work around. It made more sense to go this route since I was already using the Bing Map API.

First step is to add the Bing Maps to your app. To sum up the stepsYou just have to download and add it to your solution then reference it from your default.html.

Reverse Geocode

function getLocation(lat, lng) {
                var location = '';
                var query =  lat + "," +  lng;
                var searchRequest =
                    'http://dev.virtualearth.net/REST/v1/Locations/' + query + '?o=json&key=' +'Your Bing Key';
                var promise = WinJS.xhr({ url: searchRequest });
                promise.done(
                 // Complete function
                 function (response) {
                     var json = JSON.parse(response.responseText);
                     location = json.resourceSets[0].resources[0].name; // address is stored here
                     return location;
                 },
                 // Error function
                 function (response) {
                     // handle error here...
                     return location;
                 }
              );
            }

Graveyard Database Logo

Has everything you want to know about grave yards. Plus has many celebrites and world leaders graves. Pssst it is my other site

Google + Profile
Check out Android Photo Mapping, its a app/site I been working on
  • wholesale nfl jerseys
  • wholesale nfl jerseys china
  • wholesale sports jerseys