In the transition from ArcGIS Pro 2.9 to Pro 3 the ArcGIS.Desktop.Mapping.LayerPosition was removed i.e.
see https://pro.arcgis.com/en/pro-app/3.0/sdk/api-reference/topic15120.html
look in API Changes Detailed List of Changes ArcGIS-Core 15th instance of 29 for LayerPosition.
The LayerPosition.AutoArrange option was very handy for adding external basemaps to a map. It would group basemaps together at the bottom of the Table Of Contents.
As in this useage:
layer = await QueuedTask.Run(() => LayerFactory.Instance.CreateLayer(uri, mapView.Map, LayerPosition.AddToTop, ShowName));
Alternative create an equivalent method or enum with the same functionality as the AutoArrage option.
It got moved to MapMemberCreationParams class. Please use the MapMemberPosition property of this class for this.
Please let me know if it doesn't work for you.
Thanks
Thanks @TanuHoque
that was the clue I need to convert my code across.
For anybody else that needs help here is a code snippet:
// Create the parameters
// note many more parameters are possible
// Use this pattern to create Feature layers, service layers ...
var parmeters = new LayerCreationParams(uri)
{
Name = ShowName,
MapMemberPosition = MapMemberPosition.AutoArrange,
IsVisible= true,
};
// Layers such as the world toppgraphic and basemaps added via Layer > Basmap > select from gallery are not feature layers.
layer = await QueuedTask.Run(() => LayerFactory.Instance.CreateLayer<Layer>(parmeters, mapView.Map));
uri is the Uri(Path to the service providing the basemap) e.g. https://services.thelist.tas.gov.au/arcgis/rest/services/Basemaps/Topographic/MapServer
ShowName is a string describing the layer.
If people are interested in getting the index themselves: this link was useful:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.