import { isOGCFeatureGraphicOrigin } from "@arcgis/core/graphic/isOGCFeatureGraphicOrigin.js";const { isOGCFeatureGraphicOrigin } = await $arcgis.import("@arcgis/core/graphic/isOGCFeatureGraphicOrigin.js");- Since
- ArcGIS Maps SDK for JavaScript 5.0
Provides a utility function to determine whether a graphic's origin is a OGCFeatureGraphicOrigin.
Example
// Use hitTest() to get a graphic, then check whether it originated from a OGCFeatureLayer.view.hitTest(screenPoint).then((response) => { const graphic = response.results[0]?.graphic; if (!graphic) { return; } if (isOGCFeatureGraphicOrigin(graphic.origin)) { // hitTest returned a graphic from a OGCFeatureLayer. // Use this info for your processing logic. } else { console.log("graphic's origin is NOT a OGCFeatureLayer"); }});Functions
| Name | Return Type | Object |
|---|---|---|
origin is OGCFeatureGraphicOrigin | |
isOGCFeatureGraphicOrigin
Function
Utility function that determines whether a graphic’s origin is a OGCFeatureGraphicOrigin.
- Signature
-
isOGCFeatureGraphicOrigin (origin: GraphicOrigin | null | undefined): origin is OGCFeatureGraphicOrigin
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| origin | The graphic origin to check. | |
- Returns
- origin is OGCFeatureGraphicOrigin
Returns
trueif the graphic origin is of type OGCFeatureGraphicOrigin,falseotherwise.