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