diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-20 17:22:21 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-20 17:22:21 +1300 |
commit | 0a8d47bec2a232aad6353d34a101eb82c9d4f7ae (patch) | |
tree | 2bad0ed0875b4e2ef751ffc6a7d25591cd6ae3fd /src/org/traccar/Context.java | |
parent | c5594e16882ac3ec9215c47047e857566f8166b8 (diff) | |
download | trackermap-server-0a8d47bec2a232aad6353d34a101eb82c9d4f7ae.tar.gz trackermap-server-0a8d47bec2a232aad6353d34a101eb82c9d4f7ae.tar.bz2 trackermap-server-0a8d47bec2a232aad6353d34a101eb82c9d4f7ae.zip |
Improved network location providers
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r-- | src/org/traccar/Context.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 5d6e14efc..14ef85929 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -44,6 +44,7 @@ import org.traccar.geocode.NominatimReverseGeocoder; import org.traccar.geocode.OpenCageReverseGeocoder; import org.traccar.geocode.ReverseGeocoder; import org.traccar.helper.Log; +import org.traccar.location.GoogleLocationProvider; import org.traccar.location.LocationProvider; import org.traccar.location.MozillaLocationProvider; import org.traccar.location.OpenCellIdLocationProvider; @@ -249,20 +250,21 @@ public final class Context { } if (config.getBoolean("location.enable")) { - String type = config.getString("location.type", "opencellid"); + String type = config.getString("location.type", "mozilla"); String key = config.getString("location.key"); switch (type) { - case "mozilla": + case "google": + locationProvider = new GoogleLocationProvider(key); + case "opencellid": + locationProvider = new OpenCellIdLocationProvider(key); + default: if (key != null) { locationProvider = new MozillaLocationProvider(key); } else { locationProvider = new MozillaLocationProvider(); } break; - default: - locationProvider = new OpenCellIdLocationProvider(key); - break; } } @@ -311,6 +313,7 @@ public final class Context { public static void init(IdentityManager testIdentityManager) { config = new Config(); + objectMapper = new ObjectMapper(); identityManager = testIdentityManager; } |