Skip to content
import { getThemes, getSchemes, cloneScheme } from "@arcgis/core/smartMapping/symbology/size.js";
Since
ArcGIS Maps SDK for JavaScript 4.2

Object containing helper methods for generating optimal symbols for data-driven size visualizations. The getSchemes() method is used to generate symbol properties best suited to the given geometry type and basemap.

Functions

getThemes

Function

Returns metadata for the available themes. If a basemap is provided, returns themes that work best with the given basemap.

Signature
getThemes (basemap?: Basemap | string | null | undefined): Theme[]
Parameters
ParameterTypeDescriptionRequired
basemap

The Esri basemap string or object that will be used with the returned theme(s).

Returns
Theme[]

Returns an object containing information about the available themes for the given basemap.

getSchemes

Function

Returns a primary scheme and secondary schemes defining symbol properties for size-based data-driven visualizations in a FeatureLayer. The basemap parameter determines the color of the graphics used to visualize each feature. The geometryType determines which type of symbol to return.

Signature
getSchemes (params: GetSchemesParameters): SizeSchemes | null | undefined
Parameters
ParameterTypeDescriptionRequired
params

The function parameters.

Returns
SizeSchemes | null | undefined

Returns an object containing the optimal size scheme to use for the given basemap and secondary schemes that may also be used.

Example
// gets the primary scheme for the features of the given geometry type and basemap
let schemes = sizeSchemes.getSchemes({
basemap: map.basemap,
geometryType: featureLayer.geometryType
});
// the best default scheme for the layer and basemap
let primaryScheme = schemes.primaryScheme;

cloneScheme

Function

Clones a size scheme object.

Signature
cloneScheme (scheme: SizeScheme | null | undefined): SizeScheme | null | undefined
Parameters
ParameterTypeDescriptionRequired
scheme

The SizeScheme object to clone.

Returns
SizeScheme | null | undefined

Returns a clone of the given size scheme object.

Example
// clones the primary scheme returned from the getSchemes() method
let sizeScheme = primaryScheme.clone();

Type definitions

GetSchemesParameters

Type definition

basemap

Property
Type
Basemap | string | null | undefined

The Esri basemap to pair with the visualization. This value indicates the best symbol colors for visualizing features against the given basemap. If you have a non-Esri basemap (e.g. a VectorTileLayer basemap with a custom style) or no basemap at all, then use the basemapTheme parameter instead of this parameter.

geometryType

Property
Type
"point" | "multipoint" | "polyline" | "polygon" | null

The geometry type of the features to visualize.

basemapTheme

Property
Type
BasemapTheme | null | undefined

If you have a non-Esri basemap (e.g. a VectorTileLayer basemap with a custom style) or no basemap at all, use this parameter to indicate whether the background of the visualization is light or dark.

worldScale

Property
Type
boolean | null | undefined

Indicates if the size units of the scheme will be in meters. This should be true when the scheme is intended for 3D volumetric symbology. A view must be provided if this property is set to true.

view

Property
Type
SceneView | null | undefined

The SceneView instance in which the scheme will be used. This property is only applicable when the scheme will be used in conjunction with 3D symbols.