From f8055b4ccb4a248d8bcd7914d72a18596f6c5db8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 23 Sep 2015 19:50:55 +1200 Subject: Fix minor formatting issues --- src/org/traccar/Context.java | 12 ++++++------ src/org/traccar/geocode/MapQuestReverseGeocoder.java | 13 +++---------- 2 files changed, 9 insertions(+), 16 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 29e85a42c..c36c66322 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -22,9 +22,9 @@ import org.traccar.database.IdentityManager; import org.traccar.database.PermissionsManager; import org.traccar.geocode.GisgraphyReverseGeocoder; 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.helper.Log; import org.traccar.web.WebServer; @@ -111,7 +111,7 @@ public class Context { String type = config.getString("geocoder.type", "google"); String url = config.getString("geocoder.url"); - int cacheSize = config.getInteger("geocoder.cacheSize"); + int cacheSize = config.getInteger("geocoder.cacheSize"); switch (type) { case "google": reverseGeocoder = new GoogleReverseGeocoder(cacheSize); @@ -122,10 +122,10 @@ public class Context { case "gisgraphy": reverseGeocoder = new GisgraphyReverseGeocoder(url, cacheSize); break; - case "mapquest": - String key = config.getString("geocoder.key"); - reverseGeocoder = new MapQuestReverseGeocoder(url, key, cacheSize); - break; + case "mapquest": + String key = config.getString("geocoder.key"); + reverseGeocoder = new MapQuestReverseGeocoder(url, key, cacheSize); + break; } } diff --git a/src/org/traccar/geocode/MapQuestReverseGeocoder.java b/src/org/traccar/geocode/MapQuestReverseGeocoder.java index 45df18658..e1ed18918 100644 --- a/src/org/traccar/geocode/MapQuestReverseGeocoder.java +++ b/src/org/traccar/geocode/MapQuestReverseGeocoder.java @@ -15,24 +15,17 @@ */ package org.traccar.geocode; -import java.io.InputStreamReader; -import java.net.URL; -import java.net.URLConnection; -import javax.json.Json; import javax.json.JsonArray; import javax.json.JsonObject; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.traccar.helper.Log; -import org.w3c.dom.Document; public class MapQuestReverseGeocoder extends JsonReverseGeocoder { + public MapQuestReverseGeocoder() { this("http://www.mapquestapi.com/geocoding/v1/reverse", "ABCDE", 0); } + public MapQuestReverseGeocoder(String url, String key, int cacheSize) { - super(url + "?key=" + key + "&location=%f,%f", cacheSize); + super(url + "?key=" + key + "&location=%f,%f", cacheSize); } @Override -- cgit v1.2.3