The documentation for ILayerContainerEdit.MoveLayer says:
The position specified by the 0-based index. If the index is invalid, the layer is moved to the bottom.
However this code doesn't move the layer to the bottom:
Dim srcLayer = MapView.Active.GetSelectedLayers()(0)
MapView.Active.Map.MoveLayer(srcLayer, 999)
Only 3 layers are in the map.
Solved! Go to Solution.
Hi Kirk,
The MoveLayer method does move the layer to the bottom if you pass in a valid index.
We will look into this!
But in the meantime, this code snippet will help with moving the layer to the bottom:
var srcLayer = MapView.Active.GetSelectedLayers().FirstOrDefault();
await QueuedTask.Run(() =>
{
MapView.Active.Map.MoveLayer(srcLayer, (MapView.Active.Map.Layers.Count - 1));
});
Thanks!
Uma Harano
ArcGIS Pro SDK Team.
Hi Kirk,
The MoveLayer method does move the layer to the bottom if you pass in a valid index.
We will look into this!
But in the meantime, this code snippet will help with moving the layer to the bottom:
var srcLayer = MapView.Active.GetSelectedLayers().FirstOrDefault();
await QueuedTask.Run(() =>
{
MapView.Active.Map.MoveLayer(srcLayer, (MapView.Active.Map.Layers.Count - 1));
});
Thanks!
Uma Harano
ArcGIS Pro SDK Team.