import { getThemes, getSchemes, cloneScheme } from "@arcgis/core/smartMapping/symbology/location.js";const { getThemes, getSchemes, cloneScheme } = await $arcgis.import("@arcgis/core/smartMapping/symbology/location.js");- Since
- ArcGIS Maps SDK for JavaScript 4.2
Object containing helper methods for generating optimal symbols for location-only visualizations. The getSchemes() method is used to generate symbol properties best suited to the given geometry type and basemap.
Functions
| Name | Return Type | Object |
|---|---|---|
Theme[] | | |
| | ||
| | ||
| |
getThemes
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[]
getSchemes
Returns a primary scheme and secondary schemes defining symbol properties for
location-only visualizions in
a FeatureLayer or SceneLayer.
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): LocationSchemes | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | The function parameters. | |
- Returns
- LocationSchemes | null | undefined
Returns an object containing the optimal location scheme (and secondary schemes) to use for the given basemap.
Example
// gets the primary scheme for the features of the given geometry type and basemaplet schemes = locationSchemes.getSchemes({ basemap: map.basemap, geometryType: featureLayer.geometryType});
// the best default scheme for the layer, basemap, and themelet primaryScheme = schemes.primaryScheme; cloneScheme
Clones a location scheme object.
- Signature
-
cloneScheme (scheme: LocationScheme | null | undefined): LocationScheme | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| scheme | The location scheme object to clone. | |
- Returns
- LocationScheme | null | undefined
Returns a clone of the given location scheme object.
Example
// clones the primary scheme returned from the getSchemes() methodlet locationScheme = primaryScheme.clone();Type definitions
GetSchemesParameters
basemap
The Esri basemap to pair with the visualization. This
value indicates the best symbol color 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
- Type
- "point" | "multipoint" | "polyline" | "polygon" | "mesh" | "multipatch" | null
The geometry type of the features to visualize.
basemapTheme
- 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.
view
- Type
- MapViewOrSceneView | 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.