aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/geocoder/NominatimGeocoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-04-21 00:23:36 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-04-21 00:23:36 +1200
commit27d1708b0e8062b143e4ca0ea818a6f0301e9a3e (patch)
treec4001e4576f454d41e0e8ec4cef39a2b54978310 /src/org/traccar/geocoder/NominatimGeocoder.java
parente2389cbb4876a52c787352f0e3866095a66eb4d5 (diff)
downloadtrackermap-server-27d1708b0e8062b143e4ca0ea818a6f0301e9a3e.tar.gz
trackermap-server-27d1708b0e8062b143e4ca0ea818a6f0301e9a3e.tar.bz2
trackermap-server-27d1708b0e8062b143e4ca0ea818a6f0301e9a3e.zip
Add language support for Nominatim (fix #3098)
Diffstat (limited to 'src/org/traccar/geocoder/NominatimGeocoder.java')
-rw-r--r--src/org/traccar/geocoder/NominatimGeocoder.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/geocoder/NominatimGeocoder.java b/src/org/traccar/geocoder/NominatimGeocoder.java
index 4f33468fd..051727e93 100644
--- a/src/org/traccar/geocoder/NominatimGeocoder.java
+++ b/src/org/traccar/geocoder/NominatimGeocoder.java
@@ -19,7 +19,7 @@ import javax.json.JsonObject;
public class NominatimGeocoder extends JsonGeocoder {
- private static String formatUrl(String url, String key) {
+ private static String formatUrl(String url, String key, String language) {
if (url == null) {
url = "http://nominatim.openstreetmap.org/reverse";
}
@@ -27,11 +27,14 @@ public class NominatimGeocoder extends JsonGeocoder {
if (key != null) {
url += "&key=" + key;
}
+ if (language != null) {
+ url += "&accept-language=" + language;
+ }
return url;
}
- public NominatimGeocoder(String url, String key, int cacheSize) {
- super(formatUrl(url, key), cacheSize);
+ public NominatimGeocoder(String url, String key, String language, int cacheSize) {
+ super(formatUrl(url, key, language), cacheSize);
}
@Override