WmtsLayer.withUri constructor
- Uri uri, {
- String layerId = '',
- String tileMatrixSetId = '',
- TileImageFormat preferredImageFormat = TileImageFormat.unknown,
Creates a WMTS layer from the specified URL, layer Id, tile matrix set Id and preferred image format.
Parameters:
uri
— The URL to a WMTS service.layerId
— The identifier of the WMTS layer.tileMatrixSetId
— The id of the tile matrix set supported by of the WMTS layer.preferredImageFormat
— The preferred image format of the WMTS layer.
Implementation
factory WmtsLayer.withUri(
Uri uri, {
String layerId = '',
String tileMatrixSetId = '',
TileImageFormat preferredImageFormat = TileImageFormat.unknown,
}) {
_initializeArcGISEnvironmentIfNeeded();
final coreURI = _CString(uri.toString());
final coreLayerId = _CString(layerId);
final coreTileMatrixSetId = _CString(tileMatrixSetId);
final handle = _withThrowingErrorHandler((errorHandler) {
return runtimecore
.RT_WMTSLayer_createWithURLLayerIdMatrixSetIdAndImageFormat(
coreURI.bytes,
coreLayerId.bytes,
coreTileMatrixSetId.bytes,
preferredImageFormat.coreValue,
errorHandler,
);
});
final WmtsLayer object = Layer._instanceCache.instanceWith(handle);
object._uri.cache(uri);
return object;
}