From 7d3454b40dfaf170000be00fdc70a11a27f78139 Mon Sep 17 00:00:00 2001 From: mikems66 <> Date: Mon, 8 Mar 2021 12:22:20 +0100 Subject: Changed variable names and number of polygon steps. --- modern/src/map/GeofenceMap.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modern') diff --git a/modern/src/map/GeofenceMap.js b/modern/src/map/GeofenceMap.js index cdf379cf..31da290d 100644 --- a/modern/src/map/GeofenceMap.js +++ b/modern/src/map/GeofenceMap.js @@ -8,10 +8,10 @@ import circle from '@turf/circle'; const circleToPolygon = (item) => { - let coord = item.area.replace(/CIRCLE|\(|\)|,/g, " ").trim().split(/ +/); - var options = {steps: 64, units: 'meters'}; - let c = circle([Number(coord[1]), Number(coord[0])], Number(coord[2]), options); - return [item.name, c.geometry]; + let coordinates = item.area.replace(/CIRCLE|\(|\)|,/g, " ").trim().split(/ +/); + var options = { steps: 32, units: 'meters' }; + let polygon = circle([Number(coordinates[1]), Number(coordinates[0])], Number(coordinates[2]), options); + return [item.name, polygon.geometry]; } const GeofenceMap = () => { -- cgit v1.2.3