aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-30 12:00:36 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-30 12:00:36 +1300
commitbe088ea967dfe7d1a7de3ec824382afc92aab128 (patch)
tree874cf566bf0c8019803203045c0739bc42bb79fd
parenteb8b9dac624fcbb68659c1d6edf33bdfae2038dc (diff)
downloadtraccar-server-be088ea967dfe7d1a7de3ec824382afc92aab128.tar.gz
traccar-server-be088ea967dfe7d1a7de3ec824382afc92aab128.tar.bz2
traccar-server-be088ea967dfe7d1a7de3ec824382afc92aab128.zip
Allow user to change address format
-rw-r--r--debug.xml2
-rw-r--r--src/org/traccar/ReverseGeocoderHandler.java8
2 files changed, 8 insertions, 2 deletions
diff --git a/debug.xml b/debug.xml
index 17cefadc4..43070f9ec 100644
--- a/debug.xml
+++ b/debug.xml
@@ -14,7 +14,7 @@
<entry key='web.path'>web</entry>
<entry key='web.debug'>true</entry>
- <entry key='geocoder.enable'>false</entry>
+ <entry key='geocoder.enable'>true</entry>
<entry key='geocoder.type'>nominatim</entry>
<entry key='geocoder.url'>http://nominatim.openstreetmap.org/reverse</entry>
diff --git a/src/org/traccar/ReverseGeocoderHandler.java b/src/org/traccar/ReverseGeocoderHandler.java
index 298f59736..62f045c17 100644
--- a/src/org/traccar/ReverseGeocoderHandler.java
+++ b/src/org/traccar/ReverseGeocoderHandler.java
@@ -33,7 +33,13 @@ public class ReverseGeocoderHandler implements ChannelUpstreamHandler {
public ReverseGeocoderHandler(ReverseGeocoder geocoder, boolean processInvalidPositions) {
this.geocoder = geocoder;
this.processInvalidPositions = processInvalidPositions;
- addressFormat = new AddressFormat();
+
+ String formatString = Context.getConfig().getString("geocoder.format");
+ if (formatString != null) {
+ addressFormat = new AddressFormat(Context.getConfig().getString("geocoder.format"));
+ } else {
+ addressFormat = new AddressFormat();
+ }
}
@Override