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