diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-20 18:11:06 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-20 18:11:06 +1300 |
commit | 192800b5261d3128386bd83d6b8b684ea417fa9b (patch) | |
tree | 6044a01d9cb8cbb17bedd854e75d36e65a3990df /src/org/traccar/Context.java | |
parent | ffd0d7f5a60b33ba45c22210d4ba5f07f2a6d789 (diff) | |
download | trackermap-server-192800b5261d3128386bd83d6b8b684ea417fa9b.tar.gz trackermap-server-192800b5261d3128386bd83d6b8b684ea417fa9b.tar.bz2 trackermap-server-192800b5261d3128386bd83d6b8b684ea417fa9b.zip |
Add support for Mozilla Location Service
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r-- | src/org/traccar/Context.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index aff72cd01..c833d0c2e 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -30,6 +30,7 @@ import org.traccar.geocode.OpenCageReverseGeocoder; import org.traccar.geocode.ReverseGeocoder; import org.traccar.helper.Log; import org.traccar.location.LocationProvider; +import org.traccar.location.MozillaLocationProvider; import org.traccar.location.OpenCellIdLocationProvider; import org.traccar.web.WebServer; @@ -153,8 +154,17 @@ public final class Context { } if (config.getBoolean("location.enable")) { + String type = config.getString("location.type", "opencellid"); String key = config.getString("location.key"); - locationProvider = new OpenCellIdLocationProvider(key); + + switch (type) { + case "mozilla": + locationProvider = new MozillaLocationProvider(); + break; + default: + locationProvider = new OpenCellIdLocationProvider(key); + break; + } } if (config.getBoolean("web.enable")) { |