diff options
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/OsmAndProtocolDecoder.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index c5884a4d0..1d4dc898a 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -32,6 +32,7 @@ import java.net.SocketAddress; import java.nio.charset.StandardCharsets; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; @@ -104,6 +105,11 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder { case "lon": position.setLongitude(Double.parseDouble(value)); break; + case "location": + List<String> location = Arrays.asList(value.split(",")); + position.setLatitude(Double.parseDouble(location.get(0))); + position.setLongitude(Double.parseDouble(location.get(1))); + break; case "speed": position.setSpeed(Double.parseDouble(value)); break; |