Add WCF.Location.GoogleMaps.Map.setBounds()
authorMatthias Schmidt <gravatronics@live.com>
Sun, 22 Mar 2015 08:01:06 +0000 (09:01 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 22 Mar 2015 08:01:06 +0000 (09:01 +0100)
wcfsetup/install/files/js/WCF.Location.js

index f0d16cd0e3b40a2b1a94579cffda372c269f6135..046315aa2396e720f884b47a8bad07b243352b86 100644 (file)
@@ -365,6 +365,19 @@ WCF.Location.GoogleMaps.Map = Class.extend({
                this._markers = [ ];
        },
        
+       /**
+        * Changes the bounds of the map.
+        * 
+        * @param       object          northEast
+        * @param       object          southWest
+        */
+       setBounds: function(northEast, southWest) {
+               this._map.fitBounds(new google.maps.LatLngBounds(
+                       new google.maps.LatLng(southWest.latitude, southWest.longitude),
+                       new google.maps.LatLng(northEast.latitude, northEast.longitude)
+               ));
+       },
+       
        /**
         * Sets the center of the map to the given position.
         *