UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

29 lines (28 loc) 1.38 kB
/** * Provides a utility function to determine whether a graphic's origin is a [GeoRSSGraphicOrigin](https://developers.arcgis.com/javascript/latest/references/core/graphic/GeoRSSGraphicOrigin/). * * @since 5.0 * @example * // Use hitTest() to get a graphic, then check whether it originated from a GeoRSSLayer. * view.hitTest(screenPoint).then((response) => { * const graphic = response.results[0]?.graphic; * if (!graphic) { * return; * } * if (isGeoRSSGraphicOrigin(graphic.origin)) { * // hitTest returned a graphic from a GeoRSSLayer. * // Use this info for your processing logic. * } else { * console.log("graphic's origin is NOT a GeoRSSLayer"); * } * }); */ import type GeoRSSGraphicOrigin from "./GeoRSSGraphicOrigin.js"; import type GraphicOrigin from "./GraphicOrigin.js"; /** * Utility function that determines whether a graphic’s origin is a [GeoRSSGraphicOrigin](https://developers.arcgis.com/javascript/latest/references/core/graphic/GeoRSSGraphicOrigin/). * * @param origin - The graphic origin to check. * @returns Returns `true` if the graphic origin is of type [GeoRSSGraphicOrigin](https://developers.arcgis.com/javascript/latest/references/core/graphic/GeoRSSGraphicOrigin/), `false` otherwise. */ export function isGeoRSSGraphicOrigin(origin: GraphicOrigin | null | undefined): origin is GeoRSSGraphicOrigin;