Skip to content
import VectorTileGraphicOrigin from "@arcgis/core/graphic/VectorTileGraphicOrigin.js";
Inheritance:
VectorTileGraphicOriginGraphicOrigin
Since
ArcGIS Maps SDK for JavaScript 4.34

Provides information about the VectorTileLayer from which a graphic originates. Origin information maybe available when a graphic is returned from methods such as MapView.hitTest() method. You can access the graphic's origin through the graphic's Graphic.origin property.

The origin information contains the style layer's id and layer index within the vector tile style. Spatial information about the actual feature represented in the style layer is returned only if the style layer is a symbol layer. Otherwise, the graphic's geometry is null.

See also
Example
// get screen point from view's click event
view.on("click", (event) => {
// Search for all features only on included layers at the clicked location
view.hitTest(event, {include: vectorTileLayer}).then((response) => {
// if graphics are returned from vector tile layer, do something with results
if (response.results.length){
response.results.forEach((result, i) => {
const layerId = result.graphic?.origin?.layerId;
const styleLayer = vectorTileLayer.getStyleLayer(layerId);
// update vector tile layer's style
});
}
})

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
layer

The layer of the origin.

layerId

The id of the style layer of the origin.

layerIndex

The index of the style layer of the origin.

Properties

PropertyTypeClass
layer
readonly
layerId
readonly
layerIndex
readonly
type
readonly
VectorTileLayer["type"]

layer

readonly Property
Type
VectorTileLayer

A layer from which a graphic originates.

layerId

readonly Property
Type
string

The unique identifier of the style layer in the vector tile style.

layerIndex

readonly Property
Type
number

The layer index of the style layer in the vector tile style.

type

readonly Property
Type
VectorTileLayer["type"]

Indicates the type of layer the graphic originated from.

Default value
"vector-tile"