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.
This commit is contained in:
Stefan Breunig 2013-03-02 01:11:02 +01:00 committed by Kevin
parent 064f55d40d
commit 4788e1119e
2 changed files with 6 additions and 4 deletions

View File

@ -139,8 +139,8 @@ L.Google = L.Class.extend({
_resize: function() { _resize: function() {
var size = this._map.getSize(); var size = this._map.getSize();
if (this._container.style.width == size.x && if (parseInt(this._container.style.width) == size.x &&
this._container.style.height == size.y) parseInt(this._container.style.height) == size.y)
return; return;
this._container.style.width = size.x + 'px'; this._container.style.width = size.x + 'px';
this._container.style.height = size.y + 'px'; this._container.style.height = size.y + 'px';

View File

@ -139,11 +139,13 @@ L.Google = L.Class.extend({
_resize: function() { _resize: function() {
var size = this._map.getSize(); var size = this._map.getSize();
if (this._container.style.width == size.x && if (parseInt(this._container.style.width) == size.x &&
this._container.style.height == size.y) parseInt(this._container.style.height) == size.y)
return; return;
this._container.style.width = size.x + 'px'; this._container.style.width = size.x + 'px';
this._container.style.height = size.y + 'px'; this._container.style.height = size.y + 'px';
google.maps.event.trigger(this._google, "resize"); google.maps.event.trigger(this._google, "resize");
}, },