import { getThemes, getSchemes, getSchemeByName, getSchemesByTag, cloneScheme } from "@arcgis/core/smartMapping/symbology/heatmap.js";const { getThemes, getSchemes, getSchemeByName, getSchemesByTag, cloneScheme } = await $arcgis.import("@arcgis/core/smartMapping/symbology/heatmap.js");- Since
- ArcGIS Maps SDK for JavaScript 4.11
Object containing helper methods for generating optimal colors for heatmap visualizations. The getSchemes() method is used to get the heatmap color schemes best suited to the given basemap.
Functions
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): Theme[]
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| 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
Returns a primary scheme and secondary schemes defining properties for
heatmap visualizations in
a point Layer. The basemap parameter determines the color schemes of the
heatmap.
- Signature
-
getSchemes (params: GetSchemesParameters): HeatmapSchemes | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | The function parameters. | |
- Returns
- HeatmapSchemes | null | undefined
Returns an object containing the optimal heatmap scheme to use for the given basemap and secondary schemes that may also be used.
Example
// gets the primary scheme for the basemaplet schemes = heatmapSchemes.getSchemes({ basemap: map.basemap});
// the best default scheme for the layer, basemap, and themelet primaryScheme = schemes.primaryScheme; getSchemeByName
- Since
- ArcGIS Maps SDK for JavaScript 4.12
Returns a heatmap scheme with the provided name.
- Signature
-
getSchemeByName (params: GetSchemesByNameParameters): HeatmapScheme | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | The function parameters. | |
- Returns
- HeatmapScheme | null | undefined
Returns the heatmap scheme with the given name.
Example
// Returns the Heatmap 4 schemelet heatmapScheme = heatmapSchemes.getSchemeByName({ basemap: map.basemap, name: "Heatmap 4"}); getSchemesByTag
- Since
- ArcGIS Maps SDK for JavaScript 4.12
Returns an array of heatmap schemes with the provided tags. These schemes define color stop properties for any layer that can be rendered with a HeatmapRenderer.
- Signature
-
getSchemesByTag (params: GetSchemesByTagParameters): HeatmapScheme[]
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | The function parameters. | |
- Returns
- HeatmapScheme[]
Returns an array of heatmap schemes either including or excluding the provided tags.
Example
// Returns all the heatmap schemes that look good in grayscalelet grayscaleSchemes = heatmapSchemes.getSchemesByTag({ basemap: map.basemap, includedTags: [ "heatmap", "grayscale" ]}); cloneScheme
Clones a heatmap scheme object.
- Signature
-
cloneScheme (scheme: HeatmapScheme | null | undefined): HeatmapScheme | null | undefined
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| scheme | The heatmap scheme object to clone. | |
- Returns
- HeatmapScheme | null | undefined
A clone of the given heatmap scheme object.
Example
// clones the primary scheme returned from the getSchemes() methodlet heatmapScheme = primaryScheme.clone();Type definitions
GetSchemesParameters
basemap
The Esri basemap to pair with the visualization. This
value indicates the best 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.
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.
GetSchemesByNameParameters
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.