diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-18 15:32:05 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-18 15:32:05 +1300 |
commit | 3990d779545c7dba72324182058ae20730311f97 (patch) | |
tree | 3b010a0ce2f2dab29503686c5cc82c6e89e01dde /src/org/traccar/Context.java | |
parent | 6ec22b7a68b5334e215662e4cb83a20f9a1cad18 (diff) | |
download | trackermap-server-3990d779545c7dba72324182058ae20730311f97.tar.gz trackermap-server-3990d779545c7dba72324182058ae20730311f97.tar.bz2 trackermap-server-3990d779545c7dba72324182058ae20730311f97.zip |
Implement location provider channel handler
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r-- | src/org/traccar/Context.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 113ed02ec..aff72cd01 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -29,6 +29,8 @@ import org.traccar.geocode.NominatimReverseGeocoder; import org.traccar.geocode.OpenCageReverseGeocoder; import org.traccar.geocode.ReverseGeocoder; import org.traccar.helper.Log; +import org.traccar.location.LocationProvider; +import org.traccar.location.OpenCellIdLocationProvider; import org.traccar.web.WebServer; public final class Context { @@ -78,6 +80,12 @@ public final class Context { return reverseGeocoder; } + private static LocationProvider locationProvider; + + public static LocationProvider getLocationProvider() { + return locationProvider; + } + private static WebServer webServer; public static WebServer getWebServer() { @@ -144,6 +152,11 @@ public final class Context { } } + if (config.getBoolean("location.enable")) { + String key = config.getString("location.key"); + locationProvider = new OpenCellIdLocationProvider(key); + } + if (config.getBoolean("web.enable")) { if (config.getString("web.type", "new").equals("new") || config.getString("web.type", "new").equals("api")) { |