当前位置 : 主页 > 网页制作 > JQuery >

jquery – Google Maps API v3地理编码商家名称

来源:互联网 收集:自由互联 发布时间:2021-06-15
是否可以使用商家名称而不是精确的街道地址进行地理编码?以下地理编码请求返回0结果.我希望能够发送商家名称,城市和州,并检索纬度和经度.这是我到目前为止: var business = "Neigh
是否可以使用商家名称而不是精确的街道地址进行地理编码?以下地理编码请求返回0结果.我希望能够发送商家名称,城市和州,并检索纬度和经度.这是我到目前为止:

var business = "Neighborhood Theatre, Charlotte, NC 28205";
geocoder.geocode({'address' : business, 'region' : 'us'}, function(results, status) {
    console.log(status);
});
不, Geocoding is specifically targeted at postal addresses.

Geocoding is the process of converting addresses
(like “1600 Amphitheatre Parkway, Mountain View, CA”)
into geographic coordinates
(like latitude 37.423021 and longitude -122.083739),

要对地理位置进行地理定位,您需要使用类似于Places API的内容

The Google Places JavaScript library’s functions enable your application to search for Places (defined in this API as establishments, geographic locations, or prominent points of interest) contained within a defined area, such as the bounds of a map, or around a fixed point.

网友评论