ArcGIS Pro 2.9 API Reference Guide
SaveAsWebMapFile(String) Method

ArcGIS.Desktop.Mapping Namespace > Map Class : SaveAsWebMapFile(String) Method
The fullpath of the webmap file to save to
Save the current map to webmap file format. This method must be called on the MCT. Use QueuedTask.Run
Syntax
public void SaveAsWebMapFile( 
   string webMapFileName
)
Public Sub SaveAsWebMapFile( _
   ByVal webMapFileName As String _
) 

Parameters

webMapFileName
The fullpath of the webmap file to save to
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
DefaultViewingMode not supported
Directory does not exist
The value of webMapFileName cannot be null
Remarks
This version currently supports 2D maps: DefaultViewingMode == ArcGIS.Core.CIM.MapViewingMode.Map.
Only webmap compatible layers will be saved out to the specified file.
A suffix of ".json" will be appended to the filename if no suffix or a different suffix is provided. If the specified filename exists it will be overwritten.
Layer symbology is converted to symbology compatible with all web map clients
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

Map Class
Map Members