Recreate tooltips on marker update
This commit is contained in:
parent
f47bf8e691
commit
5391b2a34c
@ -62,7 +62,16 @@ export const updateArea = (area: LiveAtlasPolyline | LiveAtlasPolygon | undefine
|
||||
|
||||
area.closePopup();
|
||||
area.unbindPopup();
|
||||
area.closeTooltip();
|
||||
area.unbindTooltip();
|
||||
|
||||
if (options.popup) {
|
||||
area.bindPopup(() => createPopup(options, 'AreaPopup'));
|
||||
}
|
||||
|
||||
if (options.tooltip) {
|
||||
area.bindTooltip(() => options.tooltipHTML || options.tooltip, tooltipOptions);
|
||||
}
|
||||
|
||||
if(dirty) {
|
||||
area.redraw();
|
||||
|
@ -48,7 +48,17 @@ export const updateCircle = (circle: LiveAtlasPolyline | LiveAtlasPolygon | unde
|
||||
|
||||
circle.closePopup();
|
||||
circle.unbindPopup();
|
||||
circle.bindPopup(() => createPopup(options, 'CirclePopup'));
|
||||
circle.closeTooltip();
|
||||
circle.unbindTooltip();
|
||||
|
||||
if (options.popup) {
|
||||
circle.bindPopup(() => createPopup(options, 'AreaPopup'));
|
||||
}
|
||||
|
||||
if (options.tooltip) {
|
||||
circle.bindTooltip(() => options.tooltipHTML || options.tooltip, tooltipOptions);
|
||||
}
|
||||
|
||||
circle.setStyle(options.style);
|
||||
circle.setLatLngs(getCirclePoints(options, converter, outline));
|
||||
circle.redraw();
|
||||
|
@ -44,7 +44,17 @@ export const updateLine = (line: LiveAtlasPolyline | undefined, options: LiveAtl
|
||||
|
||||
line.closePopup();
|
||||
line.unbindPopup();
|
||||
line.bindPopup(() => createPopup(options, 'LinePopup'));
|
||||
line.closeTooltip();
|
||||
line.unbindTooltip();
|
||||
|
||||
if (options.popup) {
|
||||
line.bindPopup(() => createPopup(options, 'AreaPopup'));
|
||||
}
|
||||
|
||||
if (options.tooltip) {
|
||||
line.bindTooltip(() => options.tooltipHTML || options.tooltip, tooltipOptions);
|
||||
}
|
||||
|
||||
line.setStyle(options.style);
|
||||
line.setLatLngs(options.points.map(projectPointsMapCallback, converter));
|
||||
line.redraw();
|
||||
|
Loading…
Reference in New Issue
Block a user