diff options
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r-- | src/org/traccar/Context.java | 20 |
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; } } |