mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
25 lines
609 B
TypeScript
25 lines
609 B
TypeScript
import { DivIcon, Map, Marker } from "leaflet";
|
|
import { MarkerOptions } from "leaflet";
|
|
import { LatLngExpression } from "leaflet";
|
|
|
|
export class CustomMarker extends Marker {
|
|
constructor(latlng: LatLngExpression, options?: MarkerOptions) {
|
|
super(latlng, options);
|
|
}
|
|
|
|
onAdd(map: Map): this {
|
|
this.setIcon(new DivIcon()); // Default empty icon
|
|
super.onAdd(map);
|
|
this.createIcon();
|
|
return this;
|
|
}
|
|
|
|
onRemove(map: Map): this {
|
|
super.onRemove(map);
|
|
return this;
|
|
}
|
|
|
|
createIcon() {
|
|
/* Overloaded by child classes */
|
|
}
|
|
} |