使用Bing地图进行地理编码 - 无需VEMap

时间:2011-09-14 01:47:33

标签: javascript mapping geocoding bing-maps bing

我想知道是否可以使用Bing Maps API执行地理编码(基于邮政编码或地址获取长/纬度)作为批处理过程,或者至少无需使用每个地理编码渲染地图。使用Google Maps API,流程如下所示

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    
       }
    }); 

使用Bing VEMap地图类,看起来地图和地理编码绑定在一起。

1 个答案:

答案 0 :(得分:0)

你是对的,VEMap用于显示地图。

如果您只想要位置数据,可以调用基于Bing Maps REST的Location API。

您可以在http://msdn.microsoft.com/en-us/library/ff701714.aspx

上找到有关MSDN上API的更多信息