Skip to content
import { isSceneGraphicOrigin } from "@arcgis/core/graphic/isSceneGraphicOrigin.js";
Since
ArcGIS Maps SDK for JavaScript 5.0

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

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

Functions

NameReturn TypeObject
origin is SceneGraphicOrigin

isSceneGraphicOrigin

Function

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

Signature
isSceneGraphicOrigin (origin: GraphicOrigin | null | undefined): origin is SceneGraphicOrigin
Parameters
ParameterTypeDescriptionRequired
origin

The graphic origin to check.

Returns
origin is SceneGraphicOrigin

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