aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-11-06 22:55:15 -0800
committerRyan Neuharth <neuharthr@gmail.com>2019-11-09 11:50:07 -0600
commita632ac3daaca8389e380c4c862765f46b88f1fb9 (patch)
tree4045fbc231ae95218b149dcb8710de0f57700a41 /src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java
parent56cf856e0d08b32d7b637b066e0f735209d86e21 (diff)
downloadtrackermap-server-a632ac3daaca8389e380c4c862765f46b88f1fb9.tar.gz
trackermap-server-a632ac3daaca8389e380c4c862765f46b88f1fb9.tar.bz2
trackermap-server-a632ac3daaca8389e380c4c862765f46b88f1fb9.zip
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.
Diffstat (limited to 'src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java')
-rw-r--r--src/main/java/org/traccar/geolocation/OpenCellIdGeolocationProvider.java7
1 files changed, 2 insertions, 5 deletions
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