Merge pull request #5153 from osmandapp/RefIsPartOfTheName
Ref is part of the name in context menu
This commit is contained in:
commit
1f076d769a
1 changed files with 10 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
package net.osmand.plus.mapcontextmenu.controllers;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import net.osmand.data.Amenity;
|
||||
import net.osmand.data.LatLon;
|
||||
|
@ -136,9 +137,17 @@ public class AmenityMenuController extends MenuController {
|
|||
|
||||
@Override
|
||||
public String getNameStr() {
|
||||
return amenity.getName(
|
||||
String name = amenity.getName(
|
||||
amenity.getType().isWiki() ? getPreferredMapAppLang() : getPreferredMapLang(),
|
||||
isTransliterateNames());
|
||||
Map<String, String> additionalInfo = amenity.getAdditionalInfo();
|
||||
if (additionalInfo != null) {
|
||||
String ref = additionalInfo.get("ref");
|
||||
if (!TextUtils.isEmpty(ref)) {
|
||||
return name + " (" + ref + ")";
|
||||
}
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue