require(["esri/smartMapping/symbology/location"], (locationSchemes) => { /* code goes here */ });
import * as locationSchemes from "@arcgis/core/smartMapping/symbology/location.js";
esri/smartMapping/symbology/location
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.
Method Overview
Name | Return Type | Summary | Object |
---|---|---|---|
Clones a location scheme object. | location | ||
Returns a primary scheme and secondary schemes defining symbol properties for location-only visualizions in a FeatureLayer or SceneLayer. | location | ||
Returns metadata for the available themes. | location |
Method Details
-
cloneScheme
cloneScheme(scheme){LocationScheme}
-
Clones a location scheme object.
Parameterscheme LocationSchemeThe location scheme object to clone.
ReturnsType Description LocationScheme Returns a clone of the given location scheme object. Example// clones the primary scheme returned from the getSchemes() method let locationScheme = primaryScheme.clone();
-
getSchemes
getSchemes(params){LocationSchemes}
-
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. ThegeometryType
determines which type of symbol to return.ParametersSpecificationparams ObjectSee the table below for details of each parameter that may be passed to this function.
Specificationoptional 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.basemapTheme StringoptionalIf 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
ordark
.Possible Values:"light"|"dark"
geometryType StringThe geometry type of the features to visualize.
Possible Values:"point"|"multipoint"|"polyline"|"polygon"|"mesh"|"multipatch"
view SceneViewoptionalThe 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.
worldScale BooleanoptionalIndicates if the size units of the scheme will be in meters. This should be
true
when the scheme is intended for 3D volumetric symbology. Aview
must be provided if this property is set totrue
.ReturnsType Description LocationSchemes 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 basemap let schemes = locationSchemes.getSchemes({ basemap: map.basemap, geometryType: featureLayer.geometryType }); // the best default scheme for the layer, basemap, and theme let primaryScheme = schemes.primaryScheme;
-
Returns metadata for the available themes. If a basemap is provided, returns themes that work best with the given basemap.
Parameteroptional The Esri basemap string or object that will be used with the returned theme(s).
Returns
Type Definitions
-
LocationScheme
LocationScheme LocationSchemeForPoint |LocationSchemeForPolyline |LocationSchemeForPolygon |LocationSchemeForMesh
-
Defines the symbology scheme used to visualize default location-based symbols depending on the layer's geometry type.
-
Properties defining the location-only symbology scheme used to visualize mesh features.
-
Properties defining the location-only symbology scheme used to visualize point features.
-
Properties defining the location-only symbology scheme used to visualize polygon features.
-
Properties defining the location-only symbology scheme used to visualize polyline features.
-
The return object of the getSchemes() method.
- Properties
-
primaryScheme LocationScheme
The location scheme best suited for the given basemap and geometry type.
secondarySchemes LocationScheme[]Additional location schemes that may be used to visualize data of the given geometry type overlaid on the given basemap.
basemapId StringThe ID of the basemap associated with the given schemes.
basemapTheme StringIndicates whether the average basemap color is
light
ordark
.