Skip to content

Instantly share code, notes, and snippets.

@jbritton
Created July 1, 2015 18:59
Show Gist options
  • Save jbritton/682f43fa6e549c62b094 to your computer and use it in GitHub Desktop.
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
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