From 9418ac3f86314c80850fa667b4b734bdd43f6f9a Mon Sep 17 00:00:00 2001 From: Stefan Breunig Date: Sat, 2 Mar 2013 01:11:02 +0100 Subject: [PATCH] prevent LeafletGoogle from always triggering the resize event on GoogleMaps. This is broken upstream, too, but the author of the project has been unresponsive for the past half year. --- dist/leaflet_google.js | 4 ++-- external/leaflet_google.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/leaflet_google.js b/dist/leaflet_google.js index e59c362f..36d6710e 100644 --- a/dist/leaflet_google.js +++ b/dist/leaflet_google.js @@ -139,8 +139,8 @@ L.Google = L.Class.extend({ _resize: function() { var size = this._map.getSize(); - if (this._container.style.width == size.x && - this._container.style.height == size.y) + if (parseInt(this._container.style.width) == size.x && + parseInt(this._container.style.height) == size.y) return; this._container.style.width = size.x + 'px'; this._container.style.height = size.y + 'px'; diff --git a/external/leaflet_google.js b/external/leaflet_google.js index ac5b9096..c4c323e9 100644 --- a/external/leaflet_google.js +++ b/external/leaflet_google.js @@ -139,11 +139,13 @@ L.Google = L.Class.extend({ _resize: function() { var size = this._map.getSize(); - if (this._container.style.width == size.x && - this._container.style.height == size.y) + if (parseInt(this._container.style.width) == size.x && + parseInt(this._container.style.height) == size.y) return; + this._container.style.width = size.x + 'px'; this._container.style.height = size.y + 'px'; + google.maps.event.trigger(this._google, "resize"); },