From af8f197a3ec091556869ce40298c9719038892c4 Mon Sep 17 00:00:00 2001 From: James Lyne Date: Tue, 15 Feb 2022 16:44:41 +0000 Subject: [PATCH] More robust Squaremap fill/stroke checks. Fixes #359 --- src/providers/Pl3xmapMapProvider.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/providers/Pl3xmapMapProvider.ts b/src/providers/Pl3xmapMapProvider.ts index e5e3f38..151b3e6 100644 --- a/src/providers/Pl3xmapMapProvider.ts +++ b/src/providers/Pl3xmapMapProvider.ts @@ -351,11 +351,11 @@ export default class Pl3xmapMapProvider extends MapProvider { id, type: LiveAtlasMarkerType.AREA, style: { - stroke: typeof area.stroke !== 'undefined' ? !!area.stroke : true, + stroke: (typeof area.stroke === 'undefined' || !!area.stroke) && !!area.color, color: area.color || '#3388ff', weight: area.weight || 3, opacity: typeof area.opacity !== 'undefined' ? area.opacity : 1, - fill: typeof area.fill !== 'undefined' ? !!area.fill : true, + fill: (typeof area.fill === 'undefined' || !!area.fill) && !!area.fillColor, fillColor: area.fillColor || area.color || '#3388ff', fillOpacity: area.fillOpacity || 0.2, fillRule: area.fillRule, @@ -380,7 +380,7 @@ export default class Pl3xmapMapProvider extends MapProvider { id, type: LiveAtlasMarkerType.LINE, style: { - stroke: typeof line.stroke !== 'undefined' ? !!line.stroke : true, + stroke: (typeof line.stroke === 'undefined' || !!line.stroke) && !!line.color, color: line.color || '#3388ff', weight: line.weight || 3, opacity: typeof line.opacity !== 'undefined' ? line.opacity : 1, @@ -413,11 +413,11 @@ export default class Pl3xmapMapProvider extends MapProvider { min: {x: location.x - radius[0], y: 0, z: location.z - radius[1] }, }, style: { - stroke: typeof circle.stroke !== 'undefined' ? !!circle.stroke : true, + stroke: (typeof circle.stroke === 'undefined' || !!circle.stroke) && !!circle.color, color: circle.color || '#3388ff', weight: circle.weight || 3, opacity: typeof circle.opacity !== 'undefined' ? circle.opacity : 1, - fill: typeof circle.stroke !== 'undefined' ? !!circle.stroke : true, + fill: (typeof circle.fill === 'undefined' || !!circle.fill) && !!circle.fillColor, fillColor: circle.fillColor || circle.color || '#3388ff', fillOpacity: circle.fillOpacity || 0.2, fillRule: circle.fillRule,