aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/geocoder/GeocodeFarmGeocoder.java
diff options
context:
space:
mode:
authorjon-stumpf <jon.stumpf@gmail.com>2017-02-20 10:54:34 -0500
committerjon-stumpf <jon.stumpf@gmail.com>2017-02-20 10:54:34 -0500
commit888c392af40187f3a0ecc3395495db9acd85b827 (patch)
treebeb74dff8b8052ffb4a7d3c894b2b4e5a4434973 /src/org/traccar/geocoder/GeocodeFarmGeocoder.java
parent38249673287b908c0ca55847a35ca16a7b6a0c50 (diff)
parent2449895139fa658d082c1085185003a001225bc3 (diff)
downloadtrackermap-server-888c392af40187f3a0ecc3395495db9acd85b827.tar.gz
trackermap-server-888c392af40187f3a0ecc3395495db9acd85b827.tar.bz2
trackermap-server-888c392af40187f3a0ecc3395495db9acd85b827.zip
Resolved conflict with master;
Diffstat (limited to 'src/org/traccar/geocoder/GeocodeFarmGeocoder.java')
-rw-r--r--src/org/traccar/geocoder/GeocodeFarmGeocoder.java13
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