Skip to content

Instantly share code, notes, and snippets.

@jaybo
Created March 18, 2015 08:07
Show Gist options
  • Save jaybo/2d2b64e67f9bb71d5e47 to your computer and use it in GitHub Desktop.
Save jaybo/2d2b64e67f9bb71d5e47 to your computer and use it in GitHub Desktop.
Leaflet: _initPathRoot
_initPathRoot: function () {
if (!this._pathRoot) {
this._pathRoot = L.Path.prototype._createElement('svg');
this._panes.overlayPane.appendChild(this._pathRoot);
if (this.options.zoomAnimation && L.Browser.any3d) {
L.DomUtil.addClass(this._pathRoot, 'leaflet-zoom-animated');
this.on({
'zoomanim': this._animatePathZoom,
'zoomend': this._endPathZoom
});
} else {
L.DomUtil.addClass(this._pathRoot, 'leaflet-zoom-hide');
}
this.on('moveend', this._updateSvgViewport);
this._updateSvgViewport();
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment