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;
}
area.closePopup();
area.unbindPopup();
area.bindPopup(() => createPopup(options));

View File

@ -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);

View File

@ -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);

View File

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