Skip to content

Commit

Permalink
fix: return type of lat long
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Jul 14, 2022
1 parent cfa8823 commit 86254a1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public void reverseGeocode(double latitude, double longitude, PluginCall call) {

// https://developer.android.com/reference/android/location/Address.html
JSONObject placemark = new JSONObject();
placemark.put("latitude", !String.valueOf(address.getLatitude()).isEmpty() ? address.getLatitude() : "");
placemark.put("longitude", !String.valueOf(address.getLongitude()).isEmpty() ? address.getLongitude() : "");
placemark.put("latitude", !String.valueOf(address.getLatitude()).isEmpty() ? address.getLatitude() : 0);
placemark.put("longitude", !String.valueOf(address.getLongitude()).isEmpty() ? address.getLongitude() : 0);
placemark.put("countryCode", address.getCountryCode() != null ? address.getCountryCode() : "");
placemark.put("countryName", address.getCountryName() != null ? address.getCountryName() : "");
placemark.put("postalCode", address.getPostalCode() != null ? address.getPostalCode() : "");
Expand Down Expand Up @@ -126,8 +126,8 @@ public void forwardGeocode(String addressString, PluginCall call) {
if (!latitude.isEmpty() && !longitude.isEmpty()) {
// https://developer.android.com/reference/android/location/Address.html
JSObject placemark = new JSObject();
placemark.put("latitude", latitude);
placemark.put("longitude", longitude);
placemark.put("latitude", address.getLatitude();
placemark.put("longitude", address.getLongitude());
placemark.put("countryCode", address.getCountryCode() != null ? address.getCountryCode() : "");
placemark.put("countryName", address.getCountryName() != null ? address.getCountryName() : "");
placemark.put("postalCode", address.getPostalCode() != null ? address.getPostalCode() : "");
Expand Down

0 comments on commit 86254a1

Please sign in to comment.