我有下面的代碼中,我會期望contains方法返回true,但它返回false:谷歌地圖V3 - 爲什麼LatLngBounds.contains返回false
var bounds = new google.maps.LatLngBounds(
new google.maps.LatLng(55.38942944437183, -2.7379201682812226),
new google.maps.LatLng(54.69726685890506, -1.2456105979687226)
);
var center = bounds.getCenter(); // (55.04334815163844, -1.9917653831249726)
var x = bounds.contains(center); // returns false
在同一頁上,在地圖是Map對象的引用,下面的代碼返回true預期:
map.getBounds().contains(map.getBounds().getCenter())
爲什麼我的到bounds.contains
調用返回false?
+1。 – kjy112 2011-03-23 16:17:17