最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Google Maps Geocoding API, feature from the API missing in their JS api (?) - Stack Overflow

programmeradmin3浏览0评论

The problem is simple, in the documentation for the Geocoding API they say ponent filtering exists. (Source: /)

However, if I look at the JS documentation (), it doesn't seem to be implemented. I do however remember that google earlier used to have features implemented but not written about in their API, so I wonder if anyone knows how to achieve ponent filtering with the Google Maps Geocoding API?

Thanks!

The problem is simple, in the documentation for the Geocoding API they say ponent filtering exists. (Source: https://developers.google./maps/documentation/geocoding/)

However, if I look at the JS documentation (https://developers.google./maps/documentation/javascript/geocoding), it doesn't seem to be implemented. I do however remember that google earlier used to have features implemented but not written about in their API, so I wonder if anyone knows how to achieve ponent filtering with the Google Maps Geocoding API?

Thanks!

Share Improve this question edited Dec 30, 2013 at 0:36 Kara 6,22616 gold badges53 silver badges58 bronze badges asked Jun 19, 2013 at 21:17 Alexander KuzminAlexander Kuzmin 1,1208 silver badges16 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

The documentation seems to of implemented it now. Either way, here is the code:

geocoder.geocode( 
      { 'address': address, 'ponentRestrictions':{'country':'GB'}}, 
function(results, status){
...   
});

Used to restrict results to a specific area. A filter consists of one or more of: route, locality, administrativeArea, postalCode or country. Only the results that match all the filters will be returned. Filter values support the same methods of spelling correction and partial matching as other geocoding requests. See Component Filtering in the Geocoding web service for further details.

发布评论

评论列表(0)

  1. 暂无评论