Created
October 23, 2015 14:42
-
-
Save cmulders/acbbe8a8ff170e34c37b to your computer and use it in GitHub Desktop.
Workaround for white lines between tiles in leaflet during fractional zooming (such as during fly-to and zooming animations)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Workaround for 1px lines appearing in some browsers due to fractional transforms | |
| * and resulting anti-aliasing. | |
| * https://github.com/Leaflet/Leaflet/issues/3575 | |
| */ | |
| (function(){ | |
| var originalInitTile = L.GridLayer.prototype._initTile | |
| L.GridLayer.include({ | |
| _initTile: function (tile) { | |
| originalInitTile.call(this, tile); | |
| var tileSize = this.getTileSize(); | |
| tile.style.width = tileSize.x + 1 + 'px'; | |
| tile.style.height = tileSize.y + 1 + 'px'; | |
| } | |
| }); | |
| })() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment