From e0fbff28265127d7c09b6944206e1cbc030ceb5f Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Sat, 2 Mar 2013 01:52:32 +0100 Subject: [PATCH] =?UTF-8?q?-=20disable=20Leaflet=E2=80=99s=20zoom=20animat?= =?UTF-8?q?ion=20for=20GMaps=20Layers.=20It=20was=20wrong=20=20=20anyway?= =?UTF-8?q?=20and=20due=20to=20the=20way=20Leaflet/GMaps=20worked,=20latte?= =?UTF-8?q?r=20only=20=20=20started=20zooming=20after=20former=20was=20fin?= =?UTF-8?q?ished,=20making=20zooming=20very=20=20=20slow.=20This=20is=20an?= =?UTF-8?q?=20experimental=20change.=20Please=20report=20if=20you=20have?= =?UTF-8?q?=20=20=20problems.=20-=20remove=20superfluous=20calls=20in=20Le?= =?UTF-8?q?afletGoogle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- external/leaflet_google.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/external/leaflet_google.js b/external/leaflet_google.js index c4c323e9..d25c7f36 100644 --- a/external/leaflet_google.js +++ b/external/leaflet_google.js @@ -36,12 +36,11 @@ L.Google = L.Class.extend({ this._initContainer(); this._initMapObject(); - // set up events - map.on('viewreset', this._resetCallback, this); + this._map.options.zoomAnimation = false; - this._limitedUpdate = L.Util.limitExecByInterval(this._update, 150, this); + // set up events + //~ map.on('viewreset', this._resetCallback, this); map.on('move', this._update, this); - //map.on('moveend', this._update, this); this._reset(); this._update(); @@ -51,7 +50,8 @@ L.Google = L.Class.extend({ this._map._container.removeChild(this._container); //this._container = null; - this._map.off('viewreset', this._resetCallback, this); + //~ this._map.off('viewreset', this._resetCallback, this); + this._map.options.zoomAnimation = true; this._map.off('move', this._update, this); //this._map.off('moveend', this._update, this); @@ -122,19 +122,11 @@ L.Google = L.Class.extend({ _update: function() { this._resize(); - var bounds = this._map.getBounds(); - var ne = bounds.getNorthEast(); - var sw = bounds.getSouthWest(); - var google_bounds = new google.maps.LatLngBounds( - new google.maps.LatLng(sw.lat, sw.lng), - new google.maps.LatLng(ne.lat, ne.lng) - ); var center = this._map.getCenter(); var _center = new google.maps.LatLng(center.lat, center.lng); this._google.setCenter(_center); this._google.setZoom(this._map.getZoom()); - //this._google.fitBounds(google_bounds); }, _resize: function() {