diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-23 21:41:08 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-23 21:41:08 +1200 |
commit | a307569274f315c786fa4b342f97dd9e1ac0a213 (patch) | |
tree | 29b00f8a34b0532b5a15f372a5eadfba2bc7adac /src/org/traccar/Context.java | |
parent | f8055b4ccb4a248d8bcd7914d72a18596f6c5db8 (diff) | |
parent | 5e255a26287cf8af801085f18d9802eb0feba40f (diff) | |
download | trackermap-server-a307569274f315c786fa4b342f97dd9e1ac0a213.tar.gz trackermap-server-a307569274f315c786fa4b342f97dd9e1ac0a213.tar.bz2 trackermap-server-a307569274f315c786fa4b342f97dd9e1ac0a213.zip |
Merge pull request #1422 from StefaanVanDooren/master
Add OpenCage reverse geoecoder
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r-- | src/org/traccar/Context.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index c36c66322..4629dc39b 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -25,6 +25,8 @@ import org.traccar.geocode.GoogleReverseGeocoder; import org.traccar.geocode.MapQuestReverseGeocoder; import org.traccar.geocode.NominatimReverseGeocoder; import org.traccar.geocode.ReverseGeocoder; +import org.traccar.geocode.MapQuestReverseGeocoder; +import org.traccar.geocode.OpenCageReverseGeocoder; import org.traccar.helper.Log; import org.traccar.web.WebServer; @@ -110,6 +112,7 @@ public class Context { if (config.getBoolean("geocoder.enable")) { String type = config.getString("geocoder.type", "google"); String url = config.getString("geocoder.url"); + String key = config.getString("geocoder.key"); int cacheSize = config.getInteger("geocoder.cacheSize"); switch (type) { @@ -123,8 +126,10 @@ public class Context { reverseGeocoder = new GisgraphyReverseGeocoder(url, cacheSize); break; case "mapquest": - String key = config.getString("geocoder.key"); reverseGeocoder = new MapQuestReverseGeocoder(url, key, cacheSize); + break; + case "opencage": + reverseGeocoder = new OpenCageReverseGeocoder(url, key, cacheSize); break; } } |