aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/GeolocationHandler.java
diff options
context:
space:
mode:
authorValerii Vyshniak <valeravi@vi-soft.com.ua>2017-01-23 00:51:14 +0100
committerValerii Vyshniak <valeravi@vi-soft.com.ua>2017-01-28 22:26:52 +0100
commit2c44646f6b574d399dd2d36afa2e88963c7322af (patch)
tree78c086ecadb673210d43591ce8802fd1f95c1741 /src/org/traccar/GeolocationHandler.java
parent26175114ee573caa1774a04157253789d4a93998 (diff)
downloadtrackermap-server-2c44646f6b574d399dd2d36afa2e88963c7322af.tar.gz
trackermap-server-2c44646f6b574d399dd2d36afa2e88963c7322af.tar.bz2
trackermap-server-2c44646f6b574d399dd2d36afa2e88963c7322af.zip
Reset additional parameters of GPS position after geolocation
When geolocation found a lat/lon from LBS/WIFI, only lat/lon and accuracy are updated. If protocol has copied "last" position to "Position" class before issuing the geolocation, then all other parameters of GPS position will be invalid (from "last" position). So this fix reset to 0 the altitude, speed, course and rssi.
Diffstat (limited to 'src/org/traccar/GeolocationHandler.java')
-rw-r--r--src/org/traccar/GeolocationHandler.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/org/traccar/GeolocationHandler.java b/src/org/traccar/GeolocationHandler.java
index 669c31654..31fed5dbd 100644
--- a/src/org/traccar/GeolocationHandler.java
+++ b/src/org/traccar/GeolocationHandler.java
@@ -57,6 +57,10 @@ public class GeolocationHandler implements ChannelUpstreamHandler {
position.setLatitude(latitude);
position.setLongitude(longitude);
position.setAccuracy(accuracy);
+ position.setAltitude(0);
+ position.setSpeed(0);
+ position.setCourse(0);
+ position.set(Position.KEY_RSSI, 0);
Channels.fireMessageReceived(ctx, position, event.getRemoteAddress());
}