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