Shaulin
Shaulin

Reputation: 21

How to get address(city,state, country, zipcode) from BING map api by latitude and longitude?

How to get address(city,state, country, zipcode) from BING map api by latitude and longitude?

Upvotes: 2

Views: 6997

Answers (2)

expertCode
expertCode

Reputation: 533

You can use the Bing Maps REST Services

For your case you have info in this page: Find a Location by Point

One example is: http://dev.virtualearth.net/REST/v1/Locations/47.64054,-122.12934?o=xml&key=BingMapsKey

Using jquery is something like this:

$.ajax({
    url: 'http://dev.virtualearth.net/REST/v1/Locations/' + latitude + ',' + longitude,
    data: {
        o: 'xml',
        key: BingMapsKey
    },
    jsonp: "jsonp",
    success: function (data) {
        //Process the result
    },
    error: function(){
        //Process the error
    }
});

Upvotes: 2

Dennis Ward
Dennis Ward

Reputation: 757

Shaulin - You are trying to do "reverse geocoding". Have you tried to use the bing api's described in the Bing Map Geocode Service API docs

Hope this helps (if not, maybe you can be more specific with the question). At the very least, search for "reverse geocoding bing maps" will be helpful.

Good Luck, Dennis

Upvotes: 1

Related Questions