diff options
author | jcardus <joaquim.cardeira@gmail.com> | 2020-01-21 16:50:59 +0000 |
---|---|---|
committer | jcardus <joaquim.cardeira@gmail.com> | 2020-01-21 16:50:59 +0000 |
commit | 3cb539716714b08056a8751493e8a82bcdcf2764 (patch) | |
tree | 1408a4c8a777c15d0dbc662b6f58496cce1cc2a8 | |
parent | 287500912a9909b67017704da487eb33106ff9e9 (diff) | |
download | traccar-server-3cb539716714b08056a8751493e8a82bcdcf2764.tar.gz traccar-server-3cb539716714b08056a8751493e8a82bcdcf2764.tar.bz2 traccar-server-3cb539716714b08056a8751493e8a82bcdcf2764.zip |
added new parameter apiKey and kept app_code for retro compatibility
added default url for here
-rw-r--r-- | src/main/java/org/traccar/geocoder/HereGeocoder.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/org/traccar/geocoder/HereGeocoder.java b/src/main/java/org/traccar/geocoder/HereGeocoder.java index 2010d360c..a204ddfab 100644 --- a/src/main/java/org/traccar/geocoder/HereGeocoder.java +++ b/src/main/java/org/traccar/geocoder/HereGeocoder.java @@ -20,14 +20,18 @@ import javax.json.JsonObject; public class HereGeocoder extends JsonGeocoder { private static String formatUrl(String url, String id, String key, String language) { - url += "?mode=retrieveAddresses&maxresults=1"; - url += "&prox=%f,%f,0"; - url += "&app_id=" + id; - url += "&app_code=" + key; - if (language != null) { - url += "&language=" + language; - } - return url; + if (url == null) { + url = "https://reverse.geocoder.ls.hereapi.com/6.2/reversegeocode.json"; + } + url += "?mode=retrieveAddresses&maxresults=1"; + url += "&prox=%f,%f,0"; + url += "&app_id=" + id; + url += "&app_code=" + key; + url += "&apiKey=" + key; + if (language != null) { + url += "&language=" + language; + } + return url; } public HereGeocoder(String url, String id, String key, String language, |