From dc3953e866ad9f631839ac46a9c9a7a2af20e18c Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 25 Apr 2017 10:05:28 +0200 Subject: [PATCH] Fix Poi menu #3681 --- OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java | 3 ++- OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapPoint.java | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java index 55af4578dd..7e59c56854 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuBuilder.java @@ -65,7 +65,8 @@ public class EditPOIMenuBuilder extends MenuBuilder { } for (Map.Entry e : point.getEntity().getTags().entrySet()) { - if (EditPoiData.POI_TYPE_TAG.equals(e.getKey())) { + if (EditPoiData.POI_TYPE_TAG.equals(e.getKey()) || + e.getKey().startsWith(EditPoiData.REMOVE_TAG_PREFIX)) { continue; } String text = e.getKey() + "=" + e.getValue(); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapPoint.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapPoint.java index b757b22d41..24ffc89fda 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapPoint.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapPoint.java @@ -2,6 +2,7 @@ package net.osmand.plus.osmedit; import net.osmand.osm.edit.Node; import net.osmand.osm.edit.OSMSettings.OSMTagKey; +import net.osmand.util.Algorithms; public class OpenstreetmapPoint extends OsmPoint { private static final long serialVersionUID = 729654300829771467L; @@ -26,7 +27,8 @@ public class OpenstreetmapPoint extends OsmPoint { public String getType() { String type = "amenity"; for (String k : entity.getTagKeySet()) { - if (!OSMTagKey.NAME.getValue().equals(k) && !OSMTagKey.OPENING_HOURS.getValue().equals(k)) { + if (!OSMTagKey.NAME.getValue().equals(k) && !OSMTagKey.OPENING_HOURS.getValue().equals(k) && + !k.startsWith(EditPoiData.REMOVE_TAG_PREFIX)) { type = k; break; } @@ -35,6 +37,9 @@ public class OpenstreetmapPoint extends OsmPoint { } public String getSubtype() { + if(Algorithms.isEmpty(getType())) { + return ""; + } return entity.getTag(this.getType()); }