Created
July 1, 2015 18:59
-
-
Save jbritton/682f43fa6e549c62b094 to your computer and use it in GitHub Desktop.
Extending L.ImageOverlay to add the layer to the tile pane instead of the overlay pane
This file contains 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
var TileImageOverlay = L.ImageOverlay.extend({ | |
onAdd: function (map) { | |
this._map = map; | |
if (!this._image) { | |
this._initImage(); | |
} | |
// NOTE: adding to tilePane instead of overlayPane | |
map._panes.tilePane.appendChild(this._image); | |
map.on('viewreset', this._reset, this); | |
if (map.options.zoomAnimation && L.Browser.any3d) { | |
map.on('zoomanim', this._animateZoom, this); | |
} | |
this._reset(); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment