diff options
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")) { |