withUri static method

ArcGISMap? withUri(
  1. Uri uri
)

Creates a map with the URL to a web map.

If the specified URL is a portal item URL, the underlying PortalItem is created and can be accessed through GeoModel.item. The URL can be a URL to web map JSON content or the URL of a portal item.

Examples of supported URL formats:

Parameters:

  • uri — URL of a web map on ArcGIS Online or ArcGIS Enterprise portal.

Implementation

static ArcGISMap? withUri(
  Uri uri,
) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreURI = _CString(uri.toString());
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_Map_createWithURI(
      coreURI.bytes,
      errorHandler,
    );
  });
  if (handle == ffi.nullptr) return null;
  return GeoModel._instanceCache.instanceWith(handle);
}