diff options
author | mikems66 <> | 2021-03-08 12:22:20 +0100 |
---|---|---|
committer | mikems66 <> | 2021-03-08 12:22:20 +0100 |
commit | 7d3454b40dfaf170000be00fdc70a11a27f78139 (patch) | |
tree | 67da3c1c128cae3de703e8da5856961c06db77c6 /modern/src/map | |
parent | b06183b783ee62bec91002af3fa78519323162bd (diff) | |
download | etbsa-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.js | 8 |
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 = () => { |