ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / SetBasemapLayers Method / SetBasemapLayers(Item) Method
The local basemap whose layers will be used as basemap content
Version

SetBasemapLayers(Item) Method
Sets the current basemap layers in the map. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public void SetBasemapLayers( 
   Item baseMapItem
)

Parameters

baseMapItem
The local basemap whose layers will be used as basemap content
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
 
Remarks
Use this flavor of SetBasemapLayers with either:
o A base map PortalItem retrieved from your portal or organization (ArcGIS.Desktop.Core.ArcGISPortalExtensions.GetBasemapsAsync)
o A local base map MapProjectItem within your project (created either via the UI or via the API MapFactory.CreateLocalBasemap)
Attempting to use any other kind of item will result in an System.ArgumentException
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also