AnnotationLayer class final
A layer that can visualize annotation text data.
Annotation can be used to symbolize text on your maps as described in the ArcGIS Pro "Annotation" documentation. Annotation is defined using a text string, geographical location, and display properties such as font, size, and color. This information is stored in an annotation feature class in a geodatabase.
There are two kinds of annotation:
- Standard annotation is not formally associated with features in the geodatabase. An example of standard annotation is the text on a map for a mountain range. No specific feature represents the mountain range, but it is an area you want to mark. Standard annotation is read-only.
- Feature-linked annotation is associated with a specific feature in another feature class in the geodatabase. The text in feature-linked annotation reflects the value of a field or fields from the feature to which it is linked. For example, the water transmission mains in a water network can be annotated with their names, which are stored in a field in the transmission mains feature class. If you edit the attributes and/or geographical position of the feature associated with the feature-linked annotation, any changes will be applied to the annotation feature table, and visible changes to the annotation will be reflected in the ArcGISMapViewController. If the feature-linked annotation is stored in an Enterprise server, its feature and annotation tables must contain global object ids.
You can construct an annotation layer using any of the following:
- URL or portal item of an online annotation feature class
- Feature table containing annotation features:
- An online ServiceFeatureTable that has a feature layer service type of ArcGISFeatureLayerInfoServiceType.annotationLayer.
- An offline GeodatabaseFeatureTable returned by the Geodatabase.geodatabaseAnnotationTables collection when a GenerateGeodatabaseJob has completed.
Each annotation layer is partitioned into annotation sublayers. Each annotation sublayer corresponds to the label class of the original labels that were used to publish the annotation. In ArcGIS Pro, the annotation sublayers are known as annotation classes. Annotation sublayers offer greater control over the annotation:
- An author can set different visual properties on the sublayer compared to the parent annotation layer. For example, font, size, color, or different minimum and maximum scale ranges.
- You can access the annotation sublayer metadata information, such as the legend information, and set the visibility of each annotation sublayer.
Annotation respects the reference scale defined by the map, so annotation will always be presented to the user at the correct size and position, as defined by the annotation author.
Annotation layers can be taken offline from a feature service hosted on ArcGIS Enterprise 10.7.1 or later, using the GeodatabaseSyncTask. Annotation layers are also supported in mobile map packages created in ArcGIS Pro 2.3 or later.
If your annotation feature class was created with ArcGIS Desktop, it will not display in an AnnotationLayer. To display the annotation data, you must upgrade the annotation dataset using the ArcGIS Pro Data Management tool called Upgrade Dataset before you publish it. For more information see the Managing annotation feature classes documentation.
Constructors
- AnnotationLayer.withFeatureTable(ArcGISFeatureTable featureTable)
-
Creates an annotation layer from a feature table containing annotation
features.
factory
- AnnotationLayer.withItem({required Item item, required int layerId})
-
Creates a new annotation layer object from a feature service portal item.
factory
- AnnotationLayer.withUri(Uri uri)
-
Creates a new annotation layer from a feature service URI.
factory
Properties
- attribution → String
-
The attribution text for the layer.
no setterinherited
- canChangeVisibility → bool
-
A flag indicating whether the layer content's visibility can be changed.
no setterinherited
- definitionExpression ↔ String
-
A SQL statement where clause that stipulates a subset of features to be
displayed.
getter/setter pair
- description ↔ String
-
The description for the layer.
getter/setter pairinherited
- featureTable → ArcGISFeatureTable?
-
The feature table associated with this layer.
no setter
- fullExtent → Envelope?
-
The full extent of this layer, which is the extent where all layer data is
contained.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- id ↔ String
-
The unique identifying string for the layer, as specified in a map or
scene.
getter/setter pairinherited
- isIdentifyEnabled → bool
-
True if the layer supports identify, false otherwise.
no setterinherited
- isVisible ↔ bool
-
The layer content's visibility.
getter/setter pairinherited
- item → Item?
-
The item the layer has been created from.
no setterinherited
- layerId → int
-
The layer ID that defines the layer within the feature service portal
item.
no setter
- loadError → ArcGISException?
-
The load error.
no setterinherited
- loadStatus → LoadStatus
-
The load status.
no setterinherited
- maxScale ↔ double
-
The maximum scale for the layer.
getter/setter pairinherited
- minScale ↔ double
-
The minimum scale for the layer.
getter/setter pairinherited
- name ↔ String
-
The layer content's name.
getter/setter pairinherited
-
onLoadStatusChanged
→ Stream<
LoadStatus> -
A stream that reports changes to the
LoadStatus
.no setterinherited -
onSubLayerContentChanged
→ Stream<
List< LayerContent> > -
Callback invoked when the sublayer content of the layer content have
changed.
no setterinherited
-
onVisibilityChanged
→ Stream<
bool> -
Callback invoked when the visibility of the layer changes.
no setterinherited
- opacity ↔ double
-
The opacity for the layer.
getter/setter pairinherited
- referenceScale → double
-
The reference scale for the layer.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showInLegend ↔ bool
-
A flag indicating whether the layer content participates in the legend.
getter/setter pairinherited
- spatialReference → SpatialReference?
-
The spatial reference of the layer.
no setterinherited
-
subLayerContents
→ List<
LayerContent> -
The sub layer contents of a layer content.
no setterinherited
- uri → Uri?
-
The URI of a feature service to define the layer.
no setter
Methods
-
cancelLoad(
) → void -
Cancels loading metadata for the object.
inherited
-
clearSelection(
) → void - Updates any selected features in the layer back to the un-selected state.
-
clone(
) → Layer -
Clones this instance of the layer and its members.
inherited
-
fetchLegendInfos(
) → Future< List< LegendInfo> > -
Fetches the list of legend info.
inherited
-
getSelectedFeatures(
) → Future< FeatureQueryResult> - Returns a list of the currently selected features.
-
isVisibleAtScale(
double scale) → bool -
Returns the layer content's effective visibility at the specified scale.
inherited
-
load(
) → Future< void> -
Loads the metadata for the object asynchronously.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resetFeaturesVisible(
) → void - Resets the visibility of the layer's features back to the original visibility when loaded from the data source.
-
retryLoad(
) → Future< void> -
Loads or retries loading metadata for the object asynchronously.
inherited
-
selectFeature(
Feature feature) → void - Selects the given feature and adds it to the current list of selected features.
-
selectFeatures(
List< Feature> features) → void - Selects the features in the list and adds them to the current list of selected features.
-
selectFeaturesWithQuery(
{required QueryParameters parameters, required SelectionMode mode}) → Future< FeatureQueryResult> - Selects the features that match the criteria in the QueryParameters object and adds them to the current list of selected features.
-
setFeaturesVisible(
{required List< Feature> features, required bool visible}) → void - Sets the visibility of the given features.
-
setFeatureVisible(
{required Feature feature, required bool visible}) → void - Sets the visibility of the given feature.
-
toString(
) → String -
A string representation of this object.
inherited
-
unselectFeature(
Feature feature) → void - Unselects the given feature and removes it from the current list of selected features.
-
unselectFeatures(
List< Feature> features) → void - Unselects the features in the given list and removes them from the current list of selected features.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited