OfflineMapParametersKey.withLayer constructor

OfflineMapParametersKey.withLayer(
  1. Layer layer
)

Create an offline map parameters key for the given layer.

Layers that are supported for offline use are:

To construct a key the layer must be loaded, or if not loaded have a service URL available in the layer's properties. The returned key can be used to retrieve a data type specific parameters object from one of the three parameter overrides dictionaries. The dictionary that the key is valid for is indicated by its OfflineMapParametersKey.type property:

Parameter Type Dictionary
OfflineMapParametersType.generateGeodatabase GenerateOfflineMapParameterOverrides.generateGeodatabaseParameters
OfflineMapParametersType.exportVectorTiles GenerateOfflineMapParameterOverrides.exportVectorTilesParameters
OfflineMapParametersType.exportTileCache GenerateOfflineMapParameterOverrides.exportTileCacheParameters
If the layer type is not supported an error is returned with a null handle

Parameters:

Implementation

factory OfflineMapParametersKey.withLayer(
  Layer layer,
) {
  _initializeArcGISEnvironmentIfNeeded();
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_OfflineMapParametersKey_createWithLayer(
      layer._handle,
      errorHandler,
    );
  });
  return OfflineMapParametersKey._instanceCache.instanceWith(handle);
}