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:
4
dist/leaflet_google.js
vendored
4
dist/leaflet_google.js
vendored
@ -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';
|
||||
|
6
external/leaflet_google.js
vendored
6
external/leaflet_google.js
vendored
@ -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");
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user