aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Context.java
diff options
context:
space:
mode:
authorStefaan Van Dooren <stefaan.vandooren@gmail.com>2015-09-23 10:42:47 +0200
committerStefaan Van Dooren <stefaan.vandooren@gmail.com>2015-09-23 10:42:47 +0200
commit2c0fcf9c2e393d649c4c66a45bd5f1d1667d4869 (patch)
tree14bb83b1b4a823df855f9597b7ddac68b70ecbb1 /src/org/traccar/Context.java
parent6adc560279b80e551e8341df9b8643ff4c46efd0 (diff)
downloadtrackermap-server-2c0fcf9c2e393d649c4c66a45bd5f1d1667d4869.tar.gz
trackermap-server-2c0fcf9c2e393d649c4c66a45bd5f1d1667d4869.tar.bz2
trackermap-server-2c0fcf9c2e393d649c4c66a45bd5f1d1667d4869.zip
Add OpenCage ReverseGeodecoder
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r--src/org/traccar/Context.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index 29e85a42c..7f1d175e0 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -25,6 +25,7 @@ import org.traccar.geocode.GoogleReverseGeocoder;
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 +111,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,9 +125,11 @@ 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;
}
}