From a80d791ea1ae533ed6b2ac96099c200f06906af5 Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Tue, 10 Nov 2015 15:37:30 +0200 Subject: [PATCH] POIs with no_edit="true" tag are skipped --- .../src/net/osmand/plus/osmedit/OsmEditingPlugin.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index be9c00c33a..5d4aa42fb2 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -18,6 +18,7 @@ import android.widget.Toast; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; import net.osmand.data.Amenity; +import net.osmand.osm.PoiType; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick; import net.osmand.plus.OsmandApplication; @@ -166,7 +167,14 @@ public class OsmEditingPlugin extends OsmandPlugin { return true; } }; - if (selectedObj instanceof Amenity && !((Amenity) selectedObj).getType().isWiki()) { + boolean isEditable = false; + if (selectedObj instanceof Amenity) { + Amenity amenity = (Amenity) selectedObj; + final PoiType poiType = amenity.getType().getPoiTypeByKeyName(amenity.getSubType()); + isEditable = !(amenity.getType().isWiki() || + poiType.isNotEditableOsm()); + } + if (isEditable) { adapter.item(R.string.poi_context_menu_modify).iconColor(R.drawable.ic_action_edit_dark).listen(listener).position(1).reg(); adapter.item(R.string.poi_context_menu_delete).iconColor(R.drawable.ic_action_delete_dark).listen(listener).position(2).reg(); } else {