From 7c00bcbcf2ac9f99b695b7e426abc8843b59e449 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 4 Apr 2017 20:39:36 +0200 Subject: [PATCH] Fix id --- .../plus/mapcontextmenu/builders/AmenityMenuBuilder.java | 2 +- .../controllers/RenderedObjectMenuController.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index a308f81236..ac873e040c 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -473,7 +473,7 @@ public class AmenityMenuBuilder extends MenuBuilder { boolean osmEditingEnabled = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null; if (osmEditingEnabled && amenity.getId() != null && amenity.getId() > 0 && - (amenity.getId() % 2 == 1 || (amenity.getId() >> 1) < Integer.MAX_VALUE)) { + (amenity.getId() % 2 == 0 || (amenity.getId() >> 1) < Integer.MAX_VALUE)) { 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 75ee4080fe..3c9d983efe 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/RenderedObjectMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/RenderedObjectMenuController.java @@ -86,9 +86,9 @@ public class RenderedObjectMenuController extends MenuController { boolean osmEditingEnabled = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class) != null; if (osmEditingEnabled && renderedObject.getId() != null && renderedObject.getId() > 0 && - (renderedObject.getId() % 2 == 0 || (renderedObject.getId() >> 7) < Integer.MAX_VALUE)) { + (renderedObject.getId() % 2 == 1 || (renderedObject.getId() >> 7) < Integer.MAX_VALUE)) { String link; - if ((renderedObject.getId() >> 6) % 2 != 0) { + if ((renderedObject.getId() >> 6) % 2 == 1) { link = "http://www.openstreetmap.org/node/"; } else { link = "http://www.openstreetmap.org/way/";