aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-04-09 09:55:35 +1200
committerGitHub <noreply@github.com>2018-04-09 09:55:35 +1200
commitb19babee1118a4ad9833d46ae45d412a8e23e0ce (patch)
treeeb0ef8435e782cd936a57f72395065676f129de4 /src
parent179a3fdc36ce1c24f72b1a3bc2efbde33a02011d (diff)
parent9ff9232e779f7e137fa8b0cba2e0b424ff4879f9 (diff)
downloadtrackermap-server-b19babee1118a4ad9833d46ae45d412a8e23e0ce.tar.gz
trackermap-server-b19babee1118a4ad9833d46ae45d412a8e23e0ce.tar.bz2
trackermap-server-b19babee1118a4ad9833d46ae45d412a8e23e0ce.zip
Merge pull request #3838 from ivanfmartinez/polyline_distance
Use geofence attribute to permit per polyline distance configuration
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/model/Geofence.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/model/Geofence.java b/src/org/traccar/model/Geofence.java
index 7042325dc..8560d22e9 100644
--- a/src/org/traccar/model/Geofence.java
+++ b/src/org/traccar/model/Geofence.java
@@ -65,7 +65,9 @@ public class Geofence extends ScheduledModel {
} else if (area.startsWith("POLYGON")) {
geometry = new GeofencePolygon(area);
} else if (area.startsWith("LINESTRING")) {
- geometry = new GeofencePolyline(area, Context.getConfig().getDouble("geofence.polylineDistance", 25));
+ final double distance = getDouble("polylineDistance");
+ geometry = new GeofencePolyline(area, distance > 0 ? distance
+ : Context.getConfig().getDouble("geofence.polylineDistance", 25));
} else {
throw new ParseException("Unknown geometry type", 0);
}