From 50d65875f63dfea084930086c5c8711b33596013 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Thu, 30 Mar 2017 09:34:57 +0300 Subject: [PATCH] Fix #3286 --- .../plus/mapcontextmenu/builders/AmenityMenuBuilder.java | 3 ++- .../controllers/RenderedObjectMenuController.java | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index 3f84946bb6..66c0f79d4b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -471,7 +471,8 @@ public class AmenityMenuBuilder extends MenuBuilder { OsmandSettings st = ((OsmandApplication) mapActivity.getApplicationContext()).getSettings(); boolean osmEditingEnabled = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null; - if (osmEditingEnabled) { + if (osmEditingEnabled && amenity.getId() != null + && amenity.getId() > 0 && amenity.getId() < 1000000000) { String link; if (amenity.getId() % 2 == 0) { link = "http://www.openstreetmap.org/node/"; diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/RenderedObjectMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/RenderedObjectMenuController.java index 1d2a0e5154..53ea4bf3d3 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/RenderedObjectMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/RenderedObjectMenuController.java @@ -82,16 +82,17 @@ public class RenderedObjectMenuController extends MenuController { @Override public void addPlainMenuItems(String typeStr, PointDescription pointDescription, final LatLon latLon) { - super.addPlainMenuItems(typeStr, pointDescription, latLon); boolean osmEditingEnabled = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null; - if (osmEditingEnabled) { + if (osmEditingEnabled && renderedObject.getId() != null + && renderedObject.getId() > 0 && renderedObject.getId() < 1000000000) { String link; - if ((renderedObject.getId() >> 6) % 2 == 0) { + if ((renderedObject.getId() >> 6) % 2 != 0) { link = "http://www.openstreetmap.org/node/"; } else { link = "http://www.openstreetmap.org/way/"; } addPlainMenuItem(R.drawable.ic_action_info_dark, link + (renderedObject.getId() >> 7), true, true, null); } + addMyLocationToPlainItems(latLon); } }