added check if selectedObj is amenity and get it`s location

This commit is contained in:
Chumva 2018-03-09 17:26:18 +02:00
parent 2bf028a675
commit b6cc4e4c14

View file

@ -654,7 +654,12 @@ public class ContextMenuLayer extends OsmandMapLayer {
pointDescription = provider.getObjectName(selectedObj);
}
if (latLon == null) {
latLon = getLatLon(point, tileBox);
if (selectedObj instanceof Amenity) {
Amenity a = ((Amenity) selectedObj);
latLon = a.getLocation();
} else {
latLon = getLatLon(point, tileBox);
}
}
if (mInAddGpxPointMode) {
String title = pointDescription == null ? "" : pointDescription.getName();