Close existing popups during updates

This commit is contained in:
James Lyne 2021-01-26 14:42:31 +00:00
parent 746a3d0eb0
commit a966812f1a
4 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,7 @@ export const updateArea = (area: DynmapPolyline | DynmapPolygon | undefined, opt
dirty = true; dirty = true;
} }
area.closePopup();
area.unbindPopup(); area.unbindPopup();
area.bindPopup(() => createPopup(options)); area.bindPopup(() => createPopup(options));

View File

@ -50,6 +50,7 @@ export const updateCircle = (circle: DynmapPolyline | DynmapPolygon | undefined,
return createCircle(options, converter); return createCircle(options, converter);
} }
circle.closePopup();
circle.unbindPopup(); circle.unbindPopup();
circle.bindPopup(() => createPopup(options)); circle.bindPopup(() => createPopup(options));
circle.setStyle(options.style); circle.setStyle(options.style);

View File

@ -43,6 +43,7 @@ export const updateLine = (line: DynmapPolyline | undefined, options: DynmapLine
return createLine(options, converter); return createLine(options, converter);
} }
line.closePopup();
line.unbindPopup(); line.unbindPopup();
line.bindPopup(() => createPopup(options)); line.bindPopup(() => createPopup(options));
line.setStyle(options.style); line.setStyle(options.style);

View File

@ -67,6 +67,7 @@ export const updateMarker = (marker: Marker | undefined, options: DynmapMarker,
} }
} }
marker.closePopup();
marker.unbindPopup(); marker.unbindPopup();
if(options.popupContent) { if(options.popupContent) {