aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Martinez <ivanfmartinez@users.noreply.github.com>2018-04-08 10:21:13 -0300
committerIvan Martinez <ivanfmartinez@users.noreply.github.com>2018-04-08 10:21:13 -0300
commit63dc8265e5e1bc55a2c32a46b37470395c65bcb4 (patch)
tree0a8978103206c12b42e8f991d184e243e82705cb /src
parent4938acc7d9d901eed6b33f047a312b9a89bdd957 (diff)
downloadtrackermap-server-63dc8265e5e1bc55a2c32a46b37470395c65bcb4.tar.gz
trackermap-server-63dc8265e5e1bc55a2c32a46b37470395c65bcb4.tar.bz2
trackermap-server-63dc8265e5e1bc55a2c32a46b37470395c65bcb4.zip
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..acc81c203 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 >= 1 ? distance
+ : Context.getConfig().getDouble("geofence.polylineDistance", 25));
} else {
throw new ParseException("Unknown geometry type", 0);
}