From: Matthias Schmidt Date: Sun, 22 Mar 2015 08:01:06 +0000 (+0100) Subject: Add WCF.Location.GoogleMaps.Map.setBounds() X-Git-Tag: 2.1.2~19 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=42eb214da90e3fdaebd0b0eef9b8a0835f17dd2b;p=GitHub%2FWoltLab%2FWCF.git Add WCF.Location.GoogleMaps.Map.setBounds() --- 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. *