Skip to content

Instantly share code, notes, and snippets.

View gpsvisualizer's full-sized avatar

GPS Visualizer gpsvisualizer

View GitHub Profile
@up209d
up209d / leaflet.forceZIndex.js
Last active September 13, 2023 09:31
Force zIndex of Leaflet Marker
// Force zIndex of Leaflet
(function(global){
var MarkerMixin = {
_updateZIndex: function (offset) {
this._icon.style.zIndex = this.options.forceZIndex ? (this.options.forceZIndex + (this.options.zIndexOffset || 0)) : (this._zIndex + offset);
},
setForceZIndex: function(forceZIndex) {
this.options.forceZIndex = forceZIndex ? forceZIndex : null;
}
};