import { isAnnotationFeatureGraphicOrigin } from "@arcgis/core/graphic/isAnnotationFeatureGraphicOrigin.js";
Since
ArcGIS Maps SDK for JavaScript 5.1

Provides a utility function to determine whether a graphic's origin is a AnnotationFeatureGraphicOrigin.

Example
// Use hitTest() to get a graphic, then check whether it originated from a AnnotationFeatureLayer.
view.hitTest(screenPoint).then((response) => {
const graphic = response.results[0]?.graphic;
if (!graphic) {
return;
}
if (isAnnotationFeatureGraphicOrigin(graphic.origin)) {
// hitTest returned a graphic from a AnnotationFeatureLayer.
// Use this info for your processing logic.
} else {
console.log("graphic's origin is NOT a AnnotationFeatureLayer");
}
});

Functions

isAnnotationFeatureGraphicOrigin

Function

Utility function that determines whether a graphic’s origin is a AnnotationFeatureGraphicOrigin.

Signature
isAnnotationFeatureGraphicOrigin (origin: GraphicOrigin | null | undefined): origin is AnnotationFeatureGraphicOrigin

Parameters

ParameterTypeDescriptionRequired
origin

The graphic origin to check.

Returns
origin is AnnotationFeatureGraphicOrigin

Returns true if the graphic origin is of type AnnotationFeatureGraphicOrigin, false otherwise.