diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-12 07:10:11 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-04-12 07:10:11 +1200 |
commit | d88f364aca4790c1fc7775cd6e4faf488dc9fe94 (patch) | |
tree | 5f689ddb5e751a622a36b5ce5fa304afea2f9be8 /src/org/traccar/Context.java | |
parent | 427aa11193724669fbe098fd64d327f6988a9612 (diff) | |
download | trackermap-server-d88f364aca4790c1fc7775cd6e4faf488dc9fe94.tar.gz trackermap-server-d88f364aca4790c1fc7775cd6e4faf488dc9fe94.tar.bz2 trackermap-server-d88f364aca4790c1fc7775cd6e4faf488dc9fe94.zip |
Implement Unwired geolocation provider
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r-- | src/org/traccar/Context.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 68558630d..1a35a2cb4 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -44,6 +44,7 @@ import org.traccar.geocoder.MapQuestGeocoder; import org.traccar.geocoder.NominatimGeocoder; import org.traccar.geocoder.OpenCageGeocoder; import org.traccar.geocoder.Geocoder; +import org.traccar.geolocation.UnwiredGeolocationProvider; import org.traccar.helper.Log; import org.traccar.geolocation.GoogleGeolocationProvider; import org.traccar.geolocation.GeolocationProvider; @@ -249,6 +250,7 @@ public final class Context { if (config.getBoolean("geolocation.enable")) { String type = config.getString("geolocation.type", "mozilla"); + String url = config.getString("geolocation.url"); String key = config.getString("geolocation.key"); switch (type) { @@ -258,12 +260,11 @@ public final class Context { case "opencellid": geolocationProvider = new OpenCellIdGeolocationProvider(key); break; + case "unwired": + geolocationProvider = new UnwiredGeolocationProvider(url, key); + break; default: - if (key != null) { - geolocationProvider = new MozillaGeolocationProvider(key); - } else { - geolocationProvider = new MozillaGeolocationProvider(); - } + geolocationProvider = new MozillaGeolocationProvider(key); break; } } |