diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-15 20:31:52 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-15 20:31:52 +1300 |
commit | ed44b99c9decb2f56df821d642bbc511e7d90eaa (patch) | |
tree | 2c17aa7a2f799812523075f33456f84f4c9825f9 /src/org/traccar/geocoder/GeocodeFarmGeocoder.java | |
parent | 6ed2b3884d36ab133d9501983cd00bbe46fe4393 (diff) | |
download | trackermap-server-ed44b99c9decb2f56df821d642bbc511e7d90eaa.tar.gz trackermap-server-ed44b99c9decb2f56df821d642bbc511e7d90eaa.tar.bz2 trackermap-server-ed44b99c9decb2f56df821d642bbc511e7d90eaa.zip |
Support language for Google geocoder
Diffstat (limited to 'src/org/traccar/geocoder/GeocodeFarmGeocoder.java')
-rw-r--r-- | src/org/traccar/geocoder/GeocodeFarmGeocoder.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/org/traccar/geocoder/GeocodeFarmGeocoder.java b/src/org/traccar/geocoder/GeocodeFarmGeocoder.java index 585095606..db23aab79 100644 --- a/src/org/traccar/geocoder/GeocodeFarmGeocoder.java +++ b/src/org/traccar/geocoder/GeocodeFarmGeocoder.java @@ -19,14 +19,15 @@ import javax.json.JsonObject; public class GeocodeFarmGeocoder extends JsonGeocoder { - private static final String URL = "https://www.geocode.farm/v3/json/reverse/"; - - public GeocodeFarmGeocoder(int cacheSize) { - super(URL + "?lat=%f&lon=%f&country=us&lang=en&count=1", cacheSize); + private static String formatUrl(String key) { + String url = "https://www.geocode.farm/v3/json/reverse/"; + if (key != null) { + url += "&key=" + key; + } + return url; } - public GeocodeFarmGeocoder(String key, int cacheSize) { - super(URL + "?lat=%f&lon=%f&country=us&lang=en&count=1&key=" + key, cacheSize); + super(formatUrl(key), cacheSize); } @Override |