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:
parent
064f55d40d
commit
4788e1119e
4
dist/leaflet_google.js
vendored
4
dist/leaflet_google.js
vendored
@ -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';
|
||||||
|
6
external/leaflet_google.js
vendored
6
external/leaflet_google.js
vendored
@ -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");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user