Show / Hide Table of Contents

Method CreateAsync

CreateAsync(Uri)

Creates a portal item object from a portal item Url.

Declaration
public static async Task<PortalItem> CreateAsync(Uri url)
Parameters
Type Name Description
Uri url

The Url of the portal item.

Returns
Type Description
Task<PortalItem>

The task object representing the asynchronous create operation. The value of the task result is a PortalItem object.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.14 - 200.0
.NET 6.0100.14 - 200.0
.NET 6.0 Windows100.14 - 200.0
.NET 6.0 iOS200
.NET Framework100.14 - 200.0
Android100.14
iOS100.14 - 100.15
UWP100.14 - 200.0

CreateAsync(ArcGISPortal, String)

Initializes a new instance of the PortalItem class from the specified item ID.

Declaration
public static Task<PortalItem> CreateAsync(ArcGISPortal portal, string itemId)
Parameters
Type Name Description
ArcGISPortal portal

The ArcGIS portal.

String itemId

The item Id.

Returns
Type Description
Task<PortalItem>

The task object representing the asynchronous create operation. The value of the task result is a PortalItem object.

Remarks

The portal itemId can be determined from the URL of the item details web page or the map viewer URL (for maps only) in your portal. The item details page has the following format (http://www.arcgis.com/home/item.html?id=[item_id]). The webmap viewer has the following format (http://www.arcgis.com/home/webmap/viewer.html?webmap=[item_id]). In both cases, the [item_id] can be used as the ID to instantiate a portal item.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 Android200
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.15
iOS100.0 - 100.15
UWP100.0 - 200.0
Relevant samples
Display KML: Display KML from a URL, portal item, or local KML file.
Map reference scale: Set the map's reference scale and which feature layers should honor the reference scale.

CreateAsync(ArcGISPortal, String, CancellationToken)

Initializes a new instance of the PortalItem class from the specified item ID.

Declaration
public static Task<PortalItem> CreateAsync(ArcGISPortal portal, string itemId, CancellationToken cancellationToken)
Parameters
Type Name Description
ArcGISPortal portal

The ArcGIS portal.

String itemId

The item Id.

CancellationToken cancellationToken

A CancellationToken with which to cancel the operation if required.

Returns
Type Description
Task<PortalItem>

The task object representing the asynchronous create operation. The value of the task result is a PortalItem object.

Remarks

The portal itemId can be determined from the URL of the item details web page or the map viewer URL (for maps only) in your portal. The item details page has the following format (http://www.arcgis.com/home/item.html?id=[item_id]). The webmap viewer has the following format (http://www.arcgis.com/home/webmap/viewer.html?webmap=[item_id]). In both cases, the [item_id] can be used as the ID to instantiate a portal item.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 200.0
.NET 6.0100.13 - 200.0
.NET 6.0 Windows100.13 - 200.0
.NET 6.0 iOS200
.NET Framework100.0 - 200.0
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Android100.0 - 100.14
iOS100.0 - 100.15
UWP100.0 - 200.0
Relevant samples
Access load status: Determine the map's load status which can be `NotLoaded`, `FailedToLoad`, `Loading`, `Loaded`.
Add an integrated mesh layer: View an integrated mesh layer from a scene service.
Add ENC exchange set: Display nautical charts per the ENC specification.
Add features: Add features to a feature layer.
In This Article
Back to top Copyright © 2022 Esri.