2014-11-06 39 views

回答

2

bounds.extend需要一個google.maps.LatLng作爲它的參數,而不是google.maps.LatLngBounds對象,它是什麼place.geometry.viewport(可能)是。

「添加」 即google.maps.LatLngBounds到現有界限,使用bounds.union

bounds.union(place.geometry.viewport); 
+0

爲什麼這裏是工作的https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete – gstackoverflow 2014-11-06 21:37:36

+0

我在該代碼中看不到bounds.extend。請提供代碼的[最小,完整,測試和可讀示例](http://stackoverflow.com/help/mcve)。 – geocodezip 2014-11-06 21:42:24

+0

好的。你是對的。 – gstackoverflow 2014-11-06 22:29:40