From a632ac3daaca8389e380c4c862765f46b88f1fb9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 6 Nov 2019 22:55:15 -0800 Subject: Updated OpenCellId geolocation to utilize the URL parameter from the configuration file in order to allow for changes to the end point. If not set, default URL is used for backwards compatibility. --- .../org/traccar/geolocation/OpenCellIdGeolocationProvider.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/main/java/org/traccar/geolocation') diff --git a/src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java b/src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java index 768aaf6a2..88353391d 100644 --- a/src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java +++ b/src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java @@ -26,12 +26,9 @@ public class OpenCellIdGeolocationProvider implements GeolocationProvider { private String url; - public OpenCellIdGeolocationProvider(String key) { - this("http://opencellid.org/cell/get", key); - } - public OpenCellIdGeolocationProvider(String url, String key) { - this.url = url + "?format=json&mcc=%d&mnc=%d&lac=%d&cellid=%d&key=" + key; + this.url = (url == null ? "http://opencellid.org/cell/get" : url) + + "?format=json&mcc=%d&mnc=%d&lac=%d&cellid=%d&key=" + key; } @Override -- cgit v1.2.3