aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Context.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-02-15 20:31:52 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-02-15 20:31:52 +1300
commited44b99c9decb2f56df821d642bbc511e7d90eaa (patch)
tree2c17aa7a2f799812523075f33456f84f4c9825f9 /src/org/traccar/Context.java
parent6ed2b3884d36ab133d9501983cd00bbe46fe4393 (diff)
downloadtrackermap-server-ed44b99c9decb2f56df821d642bbc511e7d90eaa.tar.gz
trackermap-server-ed44b99c9decb2f56df821d642bbc511e7d90eaa.tar.bz2
trackermap-server-ed44b99c9decb2f56df821d642bbc511e7d90eaa.zip
Support language for Google geocoder
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r--src/org/traccar/Context.java20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index cd6820778..c9c2e633e 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -208,15 +208,12 @@ public final class Context {
String type = config.getString("geocoder.type", "google");
String url = config.getString("geocoder.url");
String key = config.getString("geocoder.key");
+ String language = config.getString("geocoder.language");
int cacheSize = config.getInteger("geocoder.cacheSize");
switch (type) {
case "nominatim":
- if (key != null) {
- geocoder = new NominatimGeocoder(url, key, cacheSize);
- } else {
- geocoder = new NominatimGeocoder(url, cacheSize);
- }
+ geocoder = new NominatimGeocoder(url, key, cacheSize);
break;
case "gisgraphy":
geocoder = new GisgraphyGeocoder(url, cacheSize);
@@ -234,17 +231,10 @@ public final class Context {
geocoder = new FactualGeocoder(url, key, cacheSize);
break;
case "geocodefarm":
- if (key != null) {
- geocoder = new GeocodeFarmGeocoder(key, cacheSize);
- } else {
- geocoder = new GeocodeFarmGeocoder(cacheSize);
- }
+ geocoder = new GeocodeFarmGeocoder(key, cacheSize);
+ break;
default:
- if (key != null) {
- geocoder = new GoogleGeocoder(key, cacheSize);
- } else {
- geocoder = new GoogleGeocoder(cacheSize);
- }
+ geocoder = new GoogleGeocoder(key, language, cacheSize);
break;
}
}