AnnotationLayer.withItem constructor

AnnotationLayer.withItem({
  1. required Item item,
  2. required int layerId,
})

Creates a new annotation layer object from a feature service portal item.

Parameters:

  • item — A feature service PortalItem.
  • layerId — The layer ID for which to create the layer.

Implementation

factory AnnotationLayer.withItem({
  required Item item,
  required int layerId,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_AnnotationLayer_createWithItem(
      item._handle,
      layerId,
      errorHandler,
    );
  });
  return Layer._instanceCache.instanceWith(handle);
}