diff options
author | Anshul Jain <anshuljain1985@gmail.com> | 2018-02-26 14:54:06 +0530 |
---|---|---|
committer | Anshul Jain <anshuljain1985@gmail.com> | 2018-02-26 14:54:06 +0530 |
commit | 7e973874a9c15a3c84cd948ad29c1416afc3dd2a (patch) | |
tree | ea6f0c5c5fd60115201ea53be55f0e838d362724 /src/org/traccar/geocoder/GoogleGeocoder.java | |
parent | b05d7ad4d3d805fc3c622953a85333ade00a86f2 (diff) | |
download | trackermap-server-7e973874a9c15a3c84cd948ad29c1416afc3dd2a.tar.gz trackermap-server-7e973874a9c15a3c84cd948ad29c1416afc3dd2a.tar.bz2 trackermap-server-7e973874a9c15a3c84cd948ad29c1416afc3dd2a.zip |
To use formatted address directly instead of creating address.
Diffstat (limited to 'src/org/traccar/geocoder/GoogleGeocoder.java')
-rw-r--r-- | src/org/traccar/geocoder/GoogleGeocoder.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/org/traccar/geocoder/GoogleGeocoder.java b/src/org/traccar/geocoder/GoogleGeocoder.java index 235ea9ea9..af9b58a90 100644 --- a/src/org/traccar/geocoder/GoogleGeocoder.java +++ b/src/org/traccar/geocoder/GoogleGeocoder.java @@ -46,6 +46,10 @@ public class GoogleGeocoder extends JsonGeocoder { JsonObject result = (JsonObject) results.get(0); JsonArray components = result.getJsonArray("address_components"); + if (result.containsKey("formatted_address")) { + address.setFormattedAddress(result.getString("formatted_address")); + } + for (JsonObject component : components.getValuesAs(JsonObject.class)) { String value = component.getString("short_name"); |