horrible hacks to fix iOS Safari bugging out hw-acceleration
This commit is contained in:
parent
cfde916edf
commit
592d2ce8f4
5
dist/leaflet.css
vendored
5
dist/leaflet.css
vendored
@ -140,6 +140,11 @@
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.leaflet-hack {
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.leaflet-zoom-anim .leaflet-zoom-animated {
|
||||
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
|
||||
|
@ -171,6 +171,8 @@ L.GridLayer = L.Layer.extend({
|
||||
this._bgBuffer = L.DomUtil.create('div', className, this._container);
|
||||
this._tileContainer = L.DomUtil.create('div', className, this._container);
|
||||
|
||||
L.DomUtil.setTransform(this._tileContainer);
|
||||
|
||||
} else {
|
||||
this._tileContainer = this._container;
|
||||
}
|
||||
@ -297,6 +299,14 @@ L.GridLayer = L.Layer.extend({
|
||||
for (i = 0; i < tilesToLoad; i++) {
|
||||
this._addTile(queue[i], fragment);
|
||||
}
|
||||
|
||||
if (this._zoomAnimated) {
|
||||
// a pretty funny hack - Safari bugs out with HW-acceleration when you pan to the right
|
||||
// and there are no elements in the top left corner of the tile container, this fixes it
|
||||
var hack = L.DomUtil.create('div', 'leaflet-hack', this._tileContainer);
|
||||
L.DomUtil.setTransform(hack);
|
||||
}
|
||||
|
||||
this._tileContainer.appendChild(fragment);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user