fix: solved breaking error on production with draggable paths in leaflet

This commit is contained in:
Davide Passoni
2024-12-18 14:22:19 +01:00
parent 2bbcbc5576
commit 416f0d3e36
3 changed files with 25 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
export const initDraggablePath = (L) => {
//@ts-ignore
L.PathDraggable = L.Draggable.extend({
const PathDraggable = L.Draggable.extend({
initialize: function (path) {
this._path = path;
@@ -52,7 +52,7 @@ export const initDraggablePath = (L) => {
addHooks: function () {
if (!this._draggable) {
//@ts-ignore
this._draggable = new L.PathDraggable(this._path);
this._draggable = new PathDraggable(this._path);
}
this._draggable.on(this.getEvents(), this).enable();

View File

@@ -68,7 +68,7 @@ import { SmokeMarker } from "./markers/smokemarker";
/* Register the handler for the box selection */
L.Map.addInitHook("addHandler", "boxSelect", BoxSelect);
//initDraggablePath(L); // TODO: breaks app when compiled
initDraggablePath(L); // TODO: breaks app when compiled
export class Map extends L.Map {
/* Options */