Google Maps v3 map.getBounds().containsLatLng is not a function
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How do i set the "setMap" function here to port this code to v3? Or port it generally to v3... // map recenter, if element is outside the mapscreen while ((!map.getBounds().containsLatLng(marker.getPosition())) & (showAllCategoryElements == 0)) { var newCenterPointLng = (map.getBounds().getCenter().lng() + marker.getPosition().lng()) / 2; var newCenterPointLat = (map.getBounds().getCenter().lat() + marker.getPosition().lat()) / 2; map.panTo(new google.maps.LatLng(newCenterPointLat, newCenterPointLng)); map.setCenter(new google.maps.LatLng