开发者

Geocoding with Bing Maps - without VEMap

I am wondering if it possible to use Bing Maps API to pe开发者_StackOverflow中文版rform geocoding (get long/lat based on Postal Code or address) as a batch process or at least without having to render a map with each geocode. With google maps API, the process looks like this

var geocoder=new google.maps.Geocoder();        
    geocoder.geocode({ 'address': pCodes[counter-1] }, function (results, status) {                
       if (status == google.maps.GeocoderStatus.OK){
          var pcode = results[0].address_components[0].long_name;
          var lat = results[0].geometry.location.lat();
          var lon = results[0].geometry.location.lng();                   
              // do something with results
       }
       else  {
             // error condition    
       }
    }); 

With Bing the VEMap map class, it looks like map and geocoding are bound together.


You are correct, the VEMap is for displaying maps.

If you just want location data, you can call the Bing Maps REST based Location API.

You can find out more about the API on MSDN at http://msdn.microsoft.com/en-us/library/ff701714.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜