diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java index 3afdfbdf74..303f119c3f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java @@ -398,6 +398,13 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL if (fragmentRef != null) { fragmentRef.get().rebuildMenu(centerMarker); } + ContextMenuLayer contextMenuLayer = mapActivity.getMapLayers().getContextMenuLayer(); + for (OsmandMapLayer layer : mapActivity.getMapView().getLayers()) { + if (layer instanceof ContextMenuLayer.IMoveObjectProvider && ((ContextMenuLayer.IMoveObjectProvider) layer).isObjectMovable(object)) { + contextMenuLayer.setSelectedObjectContextMenuProvider((ContextMenuLayer.IContextMenuProvider) layer); + break; + } + } centerMarker = false; } diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java index 14902589be..a34489ee2f 100644 --- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java @@ -97,6 +97,10 @@ public class ContextMenuLayer extends OsmandMapLayer { mAddGpxPointBottomSheetHelper = new AddGpxPointBottomSheetHelper(activity, this); } + public void setSelectedObjectContextMenuProvider(IContextMenuProvider provider) { + this.selectedObjectContextMenuProvider = provider; + } + public AddGpxPointBottomSheetHelper getAddGpxPointBottomSheetHelper() { return mAddGpxPointBottomSheetHelper; }