diff options
Diffstat (limited to 'src/org/traccar/model/Geofence.java')
-rw-r--r-- | src/org/traccar/model/Geofence.java | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/org/traccar/model/Geofence.java b/src/org/traccar/model/Geofence.java index 21c196da9..8560d22e9 100644 --- a/src/org/traccar/model/Geofence.java +++ b/src/org/traccar/model/Geofence.java @@ -26,7 +26,7 @@ import org.traccar.geofence.GeofencePolyline; import com.fasterxml.jackson.annotation.JsonIgnore; -public class Geofence extends ExtendedModel { +public class Geofence extends ScheduledModel { public static final String TYPE_GEOFENCE_CILCLE = "geofenceCircle"; public static final String TYPE_GEOFENCE_POLYGON = "geofencePolygon"; @@ -65,7 +65,9 @@ public class Geofence extends ExtendedModel { } 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); } @@ -87,14 +89,4 @@ public class Geofence extends ExtendedModel { area = geometry.toWkt(); this.geometry = geometry; } - - private long calendarId; - - public long getCalendarId() { - return calendarId; - } - - public void setCalendarId(long calendarId) { - this.calendarId = calendarId; - } } |