Class AnnotationLayer
An instance of this class represents a layer that can visualize annotation text data.
Namespace: Esri.ArcGISRuntime.Mapping
Assembly: Esri.ArcGISRuntime.dll
Syntax
public sealed class AnnotationLayer : Layer, INotifyPropertyChanged, ILoadable, ILayerContent
Remarks
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 map view. 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 AnnotationLayer.
- An offline GeodatabaseFeatureTable returned from the 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
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
Name | Description |
---|---|
AnnotationLayer(ArcGISFeatureTable) | Initializes a new instance of the AnnotationLayer class from a feature table containing annotation features. |
AnnotationLayer(Item, Int32) | Initializes a new instance of the AnnotationLayer class from a feature service portal item. |
AnnotationLayer(Uri) | Initializes a new instance of the AnnotationLayer class from a feature service URI. |
Properties
Name | Description |
---|---|
BarrierWeight | Gets or sets the weight of annotation features when considered as barriers to labeling. |
DefinitionExpression | Gets or sets an expression which is a SQL statement WHERE clause to specify the subset of features to be displayed. |
FeatureTable | Gets the ArcGISFeatureTable associated with the annotation layer. |
LayerId | Gets the layer ID for the layer. |
ReferenceScale | Gets the reference scale for the layer. |
Source | Gets the Feature Service URI for the layer. |
Methods
Name | Description |
---|---|
ClearSelection() | Updates any selected features in the layer back to the un-selected state. |
GetSelectedFeaturesAsync() | Returns a list of the currently selected features. |
GetSelectedFeaturesAsync(CancellationToken) | Returns a list of the currently selected features. |
ResetFeaturesVisible() | Resets the visibility of the layer's features back to the original visibility when loaded from the data source. |
SelectFeature(Feature) | Selects the given feature and adds it to the current list of selected features. |
SelectFeatures(IEnumerable<Feature>) | Selects the features in the list and adds them to the current list of selected features. |
SelectFeaturesAsync(QueryParameters, SelectionMode) | Selects the features that match the criteria in the QueryParameters object and adds them to the current list of selected features. |
SelectFeaturesAsync(QueryParameters, SelectionMode, CancellationToken) | Selects the features that match the criteria in the QueryParameters object and adds them to the current list of selected features. |
SetFeaturesVisible(IEnumerable<Feature>, Boolean) | Sets the visibility of the given features. |
SetFeatureVisible(Feature, Boolean) | Sets the visibility of the given feature. |
UnselectFeature(Feature) | Unselects the given feature and removes it from the current list of selected features. |
UnselectFeatures(IEnumerable<Feature>) | Unselects the features in the given list and removes them from the current list of selected features. |
See Also
Applies to
Target | Versions |
---|---|
.NET Standard 2.0 | 100.5 - 200.6 |
.NET | 100.13 - 200.6 |
.NET Windows | 100.13 - 200.6 |
.NET Android | 200.0 - 200.6 |
.NET iOS | 200.0 - 200.6 |
.NET Framework | 100.5 - 200.6 |
Xamarin.Android | 100.5 - 100.15 |
Xamarin.iOS | 100.5 - 100.15 |
UWP | 100.5 - 200.6 |