aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/Server.java2
-rw-r--r--src/org/traccar/TrackerEventHandler.java3
-rw-r--r--src/org/traccar/http/WebServer.java5
-rw-r--r--src/org/traccar/model/DatabaseDataManager.java1
4 files changed, 7 insertions, 4 deletions
diff --git a/src/org/traccar/Server.java b/src/org/traccar/Server.java
index 32a2888cc..15514bffc 100644
--- a/src/org/traccar/Server.java
+++ b/src/org/traccar/Server.java
@@ -193,7 +193,7 @@ public class Server {
}
private void initGeocoder(Properties properties) throws IOException {
- if (Boolean.parseBoolean("geocoder.enable")) {
+ if (Boolean.parseBoolean(properties.getProperty("geocoder.enable"))) {
geocoder = new GoogleReverseGeocoder();
}
}
diff --git a/src/org/traccar/TrackerEventHandler.java b/src/org/traccar/TrackerEventHandler.java
index 2a66a084f..07ecf71de 100644
--- a/src/org/traccar/TrackerEventHandler.java
+++ b/src/org/traccar/TrackerEventHandler.java
@@ -57,7 +57,8 @@ public class TrackerEventHandler extends SimpleChannelHandler {
", speed: " + position.getSpeed() +
", course: " + position.getCourse() +
", power: " + position.getPower() +
- ", mode: " + position.getMode());
+ ", mode: " + position.getMode() +
+ ", address: " + position.getAddress());
}
// Write position to database
diff --git a/src/org/traccar/http/WebServer.java b/src/org/traccar/http/WebServer.java
index e379a0a9a..5fac8ff65 100644
--- a/src/org/traccar/http/WebServer.java
+++ b/src/org/traccar/http/WebServer.java
@@ -146,7 +146,7 @@ public class WebServer {
Iterator<Position> i = dataManager.getPositions(Long.valueOf(deviceId)).iterator();
while (i.hasNext()) {
Position position = i.next();
- out.format("{'device_id':%d,'time':'%s','valid':%b,'latitude':%s,'longitude':%s,'speed':%s,'course':%s,'mode':%d}",
+ out.format("{'device_id':%d,'time':'%s','valid':%b,'latitude':%s,'longitude':%s,'speed':%s,'course':%s,'mode':%d,'address':'%s'}",
position.getDeviceId(),
position.getTimeFormated(),
position.getValid(),
@@ -154,7 +154,8 @@ public class WebServer {
position.getLongitude().toString(),
position.getSpeed().toString(),
position.getCourse().toString(),
- position.getMode());
+ position.getMode(),
+ position.getAddress());
if (i.hasNext()) out.print(",");
}
}
diff --git a/src/org/traccar/model/DatabaseDataManager.java b/src/org/traccar/model/DatabaseDataManager.java
index 2207d272b..3092744c0 100644
--- a/src/org/traccar/model/DatabaseDataManager.java
+++ b/src/org/traccar/model/DatabaseDataManager.java
@@ -211,6 +211,7 @@ public class DatabaseDataManager implements DataManager {
position.setCourse(result.getDouble("course"));
position.setPower(result.getDouble("power"));
position.setMode(result.getInt("mode"));
+ position.setAddress(result.getString("address"));
positionList.add(position);
}