From 1bae43d3d856b6efd706e927eda78c371d92008d Mon Sep 17 00:00:00 2001 From: Razzmatazz Date: Thu, 26 Sep 2024 17:09:27 -0500 Subject: [PATCH] artillery is square --- src/features/maps/do-fetch-maps.mjs | 8 +++++++- src/pages/map/index.js | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/features/maps/do-fetch-maps.mjs b/src/features/maps/do-fetch-maps.mjs index 69c5be8d..3f421e07 100644 --- a/src/features/maps/do-fetch-maps.mjs +++ b/src/features/maps/do-fetch-maps.mjs @@ -184,7 +184,13 @@ class MapsQuery extends APIQuery { y z } - radius + outline { + x + y + z + } + top + bottom } } } diff --git a/src/pages/map/index.js b/src/pages/map/index.js index d53aaca6..58360463 100644 --- a/src/pages/map/index.js +++ b/src/pages/map/index.js @@ -1359,7 +1359,7 @@ function Map() { if (!positionIsInBounds(hazard.position)) { continue; } - const circle = L.circle(pos(hazard.position), {radius: hazard.radius, color: '#ff0000', weight: 1, className: 'not-shown'}); + const rect = L.polygon(outlineToPoly(hazard.outline), {color: '#ff0000', weight: 1, className: 'not-shown'}); const hazardIcon = L.icon({ iconUrl: `${process.env.PUBLIC_URL}/maps/interactive/hazard_artillery.png`, iconSize: [24, 24], @@ -1373,9 +1373,9 @@ function Map() { title: artyName, //zIndexOffset: -100, position: hazard.position, - //top: hazard.top, - //bottom: hazard.bottom, - outline: circle, + top: hazard.top, + bottom: hazard.bottom, + outline: rect, }); const popup = L.DomUtil.create('div'); const hazardText = L.DomUtil.create('div', undefined, popup); @@ -1391,7 +1391,7 @@ function Map() { hazardLayers.artillery = L.layerGroup(); hazardNames.artillery = artyName; } - L.layerGroup([circle, hazardMarker]).addTo(hazardLayers.artillery); + L.layerGroup([rect, hazardMarker]).addTo(hazardLayers.artillery); checkMarkerBounds(hazard.position, markerBounds); }