OfflineMapParametersKey.withLayer constructor
- Layer layer
Create an offline map parameters key for the given layer.
Layers that are supported for offline use are:
- FeatureLayer with a table which is a ServiceFeatureTable
- ArcGISTiledLayer with an online URL
- ArcGISVectorTiledLayer with an online URL
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:
layer
— layer that is to be used to access dictionaries in GenerateOfflineMapParameterOverrides object.
Implementation
factory OfflineMapParametersKey.withLayer(Layer layer) {
_initializeArcGISEnvironmentIfNeeded();
final handle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_OfflineMapParametersKey_createWithLayer(
layer._handle, errorHandler);
});
return OfflineMapParametersKey._instanceCache.instanceWith(handle);
}