From 83bc0ec86d2b9d999314666de28a9e8e2eb73555 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Fri, 10 Sep 2021 15:31:05 +0100 Subject: [PATCH] Freeze/seal marker related objects in Pl3xmap provider --- src/providers/Pl3xmapMapProvider.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/providers/Pl3xmapMapProvider.ts b/src/providers/Pl3xmapMapProvider.ts index 40a8770..7bd2982 100644 --- a/src/providers/Pl3xmapMapProvider.ts +++ b/src/providers/Pl3xmapMapProvider.ts @@ -205,10 +205,10 @@ export default class Pl3xmapMapProvider extends MapProvider { const id = set.id; - const markers: Map = new Map(), - circles: Map = new Map(), - areas: Map = new Map(), - lines: Map = new Map(); + const markers: Map = Object.freeze(new Map()), + circles: Map = Object.freeze(new Map()), + areas: Map = Object.freeze(new Map()), + lines: Map = Object.freeze(new Map()); (set.markers || []).forEach((marker: any) => { switch(marker.type) { @@ -258,7 +258,7 @@ export default class Pl3xmapMapProvider extends MapProvider { } private static buildMarker(marker: any): LiveAtlasMarker { - return { + return Object.seal({ location: { x: marker.point?.x || 0, y: 0, @@ -269,7 +269,7 @@ export default class Pl3xmapMapProvider extends MapProvider { label: (marker.tooltip || '').trim(), isLabelHTML: true - }; + }); } private static buildRectangle(area: any): LiveAtlasArea {