diff --git a/src/util/areas.ts b/src/util/areas.ts index 0b458b0..dba7bf3 100644 --- a/src/util/areas.ts +++ b/src/util/areas.ts @@ -64,6 +64,7 @@ export const updateArea = (area: DynmapPolyline | DynmapPolygon | undefined, opt dirty = true; } + area.closePopup(); area.unbindPopup(); area.bindPopup(() => createPopup(options)); diff --git a/src/util/circles.ts b/src/util/circles.ts index 4954180..b44f8bb 100644 --- a/src/util/circles.ts +++ b/src/util/circles.ts @@ -50,6 +50,7 @@ export const updateCircle = (circle: DynmapPolyline | DynmapPolygon | undefined, return createCircle(options, converter); } + circle.closePopup(); circle.unbindPopup(); circle.bindPopup(() => createPopup(options)); circle.setStyle(options.style); diff --git a/src/util/lines.ts b/src/util/lines.ts index 3e8fd58..3b0131c 100644 --- a/src/util/lines.ts +++ b/src/util/lines.ts @@ -43,6 +43,7 @@ export const updateLine = (line: DynmapPolyline | undefined, options: DynmapLine return createLine(options, converter); } + line.closePopup(); line.unbindPopup(); line.bindPopup(() => createPopup(options)); line.setStyle(options.style); diff --git a/src/util/markers.ts b/src/util/markers.ts index 463d707..bf48a30 100644 --- a/src/util/markers.ts +++ b/src/util/markers.ts @@ -67,6 +67,7 @@ export const updateMarker = (marker: Marker | undefined, options: DynmapMarker, } } + marker.closePopup(); marker.unbindPopup(); if(options.popupContent) {