selectedAnnotation
The selected annotation.
Declaration
get selectedAnnotation(): Annotation | null;
set selectedAnnotation(annotation: Annotation | null);Discussion
The value of selectedAnnotation is either a Annotation object, if the user selects one, or null if there aren’t any selected annotations.
An annotation is in a selected state if its selected property is true. To deselect all annotations, set this property to null.
To select an annotation that’s already part of the map, set this property to the desired annotation.
When MapKit JS removes the selected annotation from the map (as an effect of removeAnnotation(annotation), removeAnnotations(annotations), or setting a new set of annotations with the annotations property), MapKit JS deselects it before removing it.