mirror of
https://github.com/BlueMap-Minecraft/BlueMapWeb.git
synced 2024-11-28 04:45:13 +01:00
Fix MarkerSet disappearing when a POI-Marker is being removed
This commit is contained in:
parent
4ee492bd1d
commit
8173979ed8
@ -45,7 +45,7 @@ export class HtmlMarker extends Marker {
|
||||
this.fadeDistanceMax = Number.MAX_VALUE;
|
||||
|
||||
this.addEventListener( 'removed', () => {
|
||||
if (this.element.parentNode) this.element.parentNode.removeChild(this.element);
|
||||
if (this.element?.parentNode) this.element.parentNode.removeChild(this.element);
|
||||
});
|
||||
|
||||
this.add(this.elementObject);
|
||||
|
@ -79,11 +79,11 @@ export class MarkerSet extends Scene {
|
||||
// add & update MarkerSets
|
||||
Object.keys(data).forEach(markerSetId => {
|
||||
if (updatedMarkerSets.has(markerSetId)) return;
|
||||
updatedMarkerSets.add(markerSetId);
|
||||
|
||||
let markerSetData = data[markerSetId];
|
||||
try {
|
||||
this.updateMarkerSetFromData(markerSetId, markerSetData);
|
||||
updatedMarkerSets.add(markerSetId);
|
||||
} catch (err) {
|
||||
alert(this.events, err, "fine");
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ export const alert = (element, message, level = "info") => {
|
||||
});
|
||||
|
||||
// log alert to console
|
||||
if (printToConsole) {
|
||||
if (printToConsole !== false) {
|
||||
if (level === "info") {
|
||||
console.log(`[BlueMap/${level}]`, message);
|
||||
} else if (level === "warning") {
|
||||
|
Loading…
Reference in New Issue
Block a user