Readded command mode options

This commit is contained in:
Davide Passoni
2024-11-07 17:39:34 +01:00
parent 454c7ad2de
commit df939f1ac3
27 changed files with 990 additions and 231 deletions

View File

@@ -7,32 +7,33 @@ export class ExplosionMarker extends CustomMarker {
#timer: number = 0;
#timeout: number = 0;
constructor(latlng: LatLng, timeout: number) {
constructor(latlng: LatLng, timeout?: number) {
super(latlng, { interactive: false });
this.#timeout = timeout;
if (timeout) {
this.#timeout = timeout;
this.#timer = window.setTimeout(() => {
this.removeFrom(getApp().getMap());
}, timeout * 1000);
this.#timer = window.setTimeout(() => {
this.removeFrom(getApp().getMap());
}, timeout * 1000);
}
}
createIcon() {
/* Set the icon */
var icon = new DivIcon({
className: "leaflet-explosion-icon",
iconAnchor: [25, 25],
iconSize: [50, 50],
});
this.setIcon(icon);
this.setIcon(
new DivIcon({
iconSize: [52, 52],
iconAnchor: [26, 52],
className: "leaflet-explosion-marker",
})
);
var el = document.createElement("div");
el.classList.add("ol-explosion-icon");
var img = document.createElement("img");
img.src = `/vite/images/markers/smoke.svg`;
img.src = "/vite/images/markers/explosion.svg";
img.onload = () => SVGInjector(img);
el.append(img);
el.appendChild(img);
this.getElement()?.appendChild(el);
this.getElement()?.classList.add("ol-temporary-marker");
}
}

View File

@@ -24,3 +24,7 @@
.airbase-icon[data-coalition="neutral"] svg * {
stroke: var(--unit-background-neutral);
}
.airbase-icon[data-selected="true"] {
filter: drop-shadow(0px 2px 0px white) drop-shadow(0px -2px 0px white) drop-shadow(2px 0px 0px white) drop-shadow(-2px 0px 0px white);
}