From 3cb539716714b08056a8751493e8a82bcdcf2764 Mon Sep 17 00:00:00 2001 From: jcardus Date: Tue, 21 Jan 2020 16:50:59 +0000 Subject: added new parameter apiKey and kept app_code for retro compatibility added default url for here --- src/main/java/org/traccar/geocoder/HereGeocoder.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/main/java/org/traccar/geocoder/HereGeocoder.java') 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, -- cgit v1.2.3