I am converting the V3 code to V3. In the two functions below, they getBoundsZoomLevel function is used. How to use that function in Google Maps v3. help please. Thanks in advance for this help. In your case you can use Map.fitBounds (LatLngBounds) "Sets viewport to cover given boundaries." Function fit Specified group () {var bounds = new google.maps.LatLngBounds (); For (var i = markers. Lamps -1; i> = 0; i--) {bounds.extend (marker [i] .getPosition ()); } Var zoomLvl = this.map.getBoundsZoomLevel (border); // V2 function is not available in v3. If (zoomLvl & gt; this.maximum zoom) {zoomLvl = this.maximum zoom; } This.map.setCenter (bounds.getCenter (), zoomLvl); } Function cluster marker () {var border = new google.maps.LatLngBounds (); Var listen = google.maps.event.addListener (marker, 'click', function () {// center and zoom map to keep all map markers in the cluster group when self.map.setCenter (bounds.getCenter) Clicked, Self.map.getBoundsZoomLevel (bounds))}}
No comments:
Post a Comment