aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map
diff options
context:
space:
mode:
authormikems66 <>2021-03-08 12:22:20 +0100
committermikems66 <>2021-03-08 12:22:20 +0100
commit7d3454b40dfaf170000be00fdc70a11a27f78139 (patch)
tree67da3c1c128cae3de703e8da5856961c06db77c6 /modern/src/map
parentb06183b783ee62bec91002af3fa78519323162bd (diff)
downloadetbsa-traccar-web-7d3454b40dfaf170000be00fdc70a11a27f78139.tar.gz
etbsa-traccar-web-7d3454b40dfaf170000be00fdc70a11a27f78139.tar.bz2
etbsa-traccar-web-7d3454b40dfaf170000be00fdc70a11a27f78139.zip
Changed variable names and number of polygon steps.
Diffstat (limited to 'modern/src/map')
-rw-r--r--modern/src/map/GeofenceMap.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/modern/src/map/GeofenceMap.js b/modern/src/map/GeofenceMap.js
index cdf379c..31da290 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 = () => {