Skip to content
import GraphicOrigin from "@arcgis/core/graphic/GraphicOrigin.js";
Subclasses:
BuildingGraphicOrigin, CSVGraphicOrigin, CatalogGraphicOrigin, FeatureGraphicOrigin, GeoJSONGraphicOrigin, GeoRSSGraphicOrigin, ImageryGraphicOrigin, ImageryTileGraphicOrigin, KMLGraphicOrigin, KnowledgeGraphGraphicOrigin, LinkChartGraphicOrigin, MapImageGraphicOrigin, MapNotesGraphicOrigin, OGCFeatureGraphicOrigin, OrientedImageryGraphicOrigin, ParquetGraphicOrigin, PointCloudGraphicOrigin, SceneGraphicOrigin, StreamGraphicOrigin, SubtypeGroupGraphicOrigin, TileGraphicOrigin, VectorTileGraphicOrigin, VoxelGraphicOrigin, WCSGraphicOrigin, WFSGraphicOrigin
Since
ArcGIS Maps SDK for JavaScript 4.34

The base class for graphic origins. This class has no constructor. Provides contextual information about where a graphic originates from, when available. Origin details may be returned by methods such as MapView.hitTest() or by calling queryFeatures() on a layer or layer view. Depending on the origin type, this information may include the source layer or other origin-related metadata.

See also
Example
// get a point from view's click event
view.on("click", async (event) => {
// Search for all features only on included layer at the clicked location
const response = await view.hitTest(event, {include: layer});
// if graphics are returned from layer, get the layer id from graphic origin
if (response.results.length > 0) {
const originId = response.results[0].graphic?.origin?.layer?.id;
}
});