Don't set a zindex on markers
This commit is contained in:
parent
6ede9adf2f
commit
1128a9b0ba
12
src/leaflet/marker/GenericMarker.ts
Normal file
12
src/leaflet/marker/GenericMarker.ts
Normal 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
|
||||
}
|
||||
}
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user