From 42eb214da90e3fdaebd0b0eef9b8a0835f17dd2b Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 22 Mar 2015 09:01:06 +0100 Subject: [PATCH] Add WCF.Location.GoogleMaps.Map.setBounds() --- wcfsetup/install/files/js/WCF.Location.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.Location.js b/wcfsetup/install/files/js/WCF.Location.js index f0d16cd0e3..046315aa23 100644 --- a/wcfsetup/install/files/js/WCF.Location.js +++ b/wcfsetup/install/files/js/WCF.Location.js @@ -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. * -- 2.20.1