有没有办法在Google Maps API(纬度和纵向)的某些范围内限制搜索?

时间:2017-06-27 15:11:39

标签: google-maps google-maps-api-3 google-api

我试图限制搜索结果。我无法使用此方法的类(google.maps.places.SearchBox)

setBounds(bounds:LatLngBounds|LatLngBoundsLiteral)

因为结果不限于界限,而是优先考虑。

1 个答案:

答案 0 :(得分:1)

目前仅在Place autocomplete中支持严格边界。

https://developers.google.com/maps/documentation/javascript/3.exp/reference#AutocompleteOptions

搜索框没有此属性

https://developers.google.com/maps/documentation/javascript/3.exp/reference#SearchBoxOptions

我建议提交feature request以在Search Box类中添加严格边界支持。