Update provider in layer after adding point
This commit is contained in:
parent
b904e2d205
commit
6169630188
2 changed files with 10 additions and 6 deletions
|
@ -399,12 +399,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
|
|||
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;
|
||||
}
|
||||
}
|
||||
contextMenuLayer.updateContextMenu();
|
||||
centerMarker = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -232,6 +232,15 @@ public class ContextMenuLayer extends OsmandMapLayer {
|
|||
this.selectOnMap = selectOnMap;
|
||||
}
|
||||
|
||||
public void updateContextMenu() {
|
||||
for (OsmandMapLayer layer : view.getLayers()) {
|
||||
if (layer instanceof ContextMenuLayer.IMoveObjectProvider && ((ContextMenuLayer.IMoveObjectProvider) layer).isObjectMovable(selectedObject)) {
|
||||
selectedObjectContextMenuProvider = (IContextMenuProvider) layer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateObjectContextMenu(LatLon latLon, Object o, ContextMenuAdapter adapter, MapActivity mapActivity) {
|
||||
if (menu.hasHiddenBottomInfo()) {
|
||||
|
|
Loading…
Reference in a new issue