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

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

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

Functions

NameReturn TypeObject

isGeoJSONGraphicOrigin

Function

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

Signature
isGeoJSONGraphicOrigin (origin: GraphicOrigin | null | undefined): origin is GeoJSONGraphicOrigin
Parameters
ParameterTypeDescriptionRequired
origin

The graphic origin to check.

Returns
origin is GeoJSONGraphicOrigin

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