Don't set a zindex on markers

This commit is contained in:
James Lyne 2020-12-14 15:48:58 +00:00
parent 6ede9adf2f
commit 1128a9b0ba
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,12 @@
import {MarkerOptions, Marker, Util, LatLngExpression} from 'leaflet';
export class GenericMarker extends Marker {
constructor(latLng: LatLngExpression, options: MarkerOptions) {
super(latLng, options);
Util.setOptions(this, options);
}
_resetZIndex() {
//Don't change the zindex
}
}

View File

@ -2,9 +2,10 @@ import {Marker} from "leaflet";
import {DynmapMarker} from "@/dynmap";
import {DynmapIcon} from "@/leaflet/icon/DynmapIcon";
import {DynmapProjection} from "@/leaflet/projection/DynmapProjection";
import {GenericMarker} from "@/leaflet/marker/GenericMarker";
export const createMarker = (options: DynmapMarker, projection: DynmapProjection): Marker => {
return new Marker(projection.locationToLatLng(options.location), {
return new GenericMarker(projection.locationToLatLng(options.location), {
icon: new DynmapIcon({
icon: options.icon,
label: options.label,