From 26eda5d6a7e9ee580bfc5b8c24d95197c3d65e41 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 21 Feb 2017 05:46:02 +1300 Subject: Fix URL problem in geocoders --- src/org/traccar/geocoder/GeocodeFarmGeocoder.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/org/traccar/geocoder/GeocodeFarmGeocoder.java') diff --git a/src/org/traccar/geocoder/GeocodeFarmGeocoder.java b/src/org/traccar/geocoder/GeocodeFarmGeocoder.java index db23aab79..73ff85aa4 100644 --- a/src/org/traccar/geocoder/GeocodeFarmGeocoder.java +++ b/src/org/traccar/geocoder/GeocodeFarmGeocoder.java @@ -19,15 +19,19 @@ import javax.json.JsonObject; public class GeocodeFarmGeocoder extends JsonGeocoder { - private static String formatUrl(String key) { + private static String formatUrl(String key, String language) { String url = "https://www.geocode.farm/v3/json/reverse/"; + url += "?lat=%f&lon=%f&country=us&count=1"; if (key != null) { url += "&key=" + key; } + if (language != null) { + url += "&lang=" + language; + } return url; } - public GeocodeFarmGeocoder(String key, int cacheSize) { - super(formatUrl(key), cacheSize); + public GeocodeFarmGeocoder(String key, String language, int cacheSize) { + super(formatUrl(key, language), cacheSize); } @Override -- cgit v1.2.3