ArcGIS Pro 3.2 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

In This Topic
    SetBasemapLayers(Item) Method
    In This Topic
    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
    )
    Public Overloads Sub SetBasemapLayers( _
       ByVal baseMapItem As Item _
    ) 

    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