Skip to content
import SpriteSource from "@arcgis/core/layers/support/SpriteSource.js";
Since
ArcGIS Maps SDK for JavaScript 5.0

The sprite source returned from the VectorTileLayer.setSpriteSource() method.

SpriteSource holds the resources needed to render patterned (textured) markers, lines and polygons. These resources are both an image and metrics (JSON). Each element is identified by a unique name

Properties

PropertyTypeClass
height
readonly
image
readonly
"not-loaded" | "loading" | "failed" | "loaded"
width
readonly

baseURL

Property
Type
string | null | undefined

The base URL to where the sprites are (both JSON and PNG)

devicePixelRatio

Property
Type
number

The device pixel ratio of the sprite source.

Default value
1

height

readonly Property
Type
number

The height in pixels of the sprite source.

image

readonly Property
Type
Uint8Array | null | undefined

The sprite image data.

loadStatus

Property
Type
"not-loaded" | "loading" | "failed" | "loaded"

Indicates whether the sprite source is loaded successfully.

Default value
"not-loaded"

width

readonly Property
Type
number

The width in pixels of the sprite source.

Methods

MethodSignatureClass
getSpriteInfo(name: string): SpriteInfo | null | undefined

getSpriteInfo

Method
Signature
getSpriteInfo (name: string): SpriteInfo | null | undefined
Since
ArcGIS Maps SDK for JavaScript 4.25

Returns the sprite info for the given sprite.

Parameters
ParameterTypeDescriptionRequired
name

Name of the sprite to get the information for.

Returns
SpriteInfo | null | undefined

Sprite info containing the dimension and pixel ratio of the image and its location within the sprite image.

Type definitions

GetSpriteInfo

deprecated Type definition

Returns information for the specified sprite.

Type
SpriteSource["getSpriteInfo"]