Display coordinates if there is no name or address

pull/935/head
Alex Baker 5 years ago
parent 3991ba052f
commit 9b338a1c7c

@ -214,7 +214,7 @@ public class Place implements Serializable, Parcelable {
public String getDisplayName() { public String getDisplayName() {
if (Strings.isNullOrEmpty(address) || !COORDS.matcher(name).matches()) { if (Strings.isNullOrEmpty(address) || !COORDS.matcher(name).matches()) {
return name; return Strings.isNullOrEmpty(name) ? formatCoordinates(this) : name;
} }
return address; return address;
} }
@ -226,7 +226,7 @@ public class Place implements Serializable, Parcelable {
String getGeoUri() { String getGeoUri() {
return String.format( return String.format(
"geo:%s,%s?q=%s", "geo:%s,%s?q=%s",
latitude, longitude, Uri.encode(Strings.isNullOrEmpty(address) ? name : address)); latitude, longitude, Uri.encode(getDisplayName()));
} }
public MapPosition getMapPosition() { public MapPosition getMapPosition() {

Loading…
Cancel
Save