cimSymbolUtils

AMD: require(["esri/symbols/support/cimSymbolUtils"], (cimSymbolUtils) => { /* code goes here */ });
ESM: import * as cimSymbolUtils from "@arcgis/core/symbols/support/cimSymbolUtils";
Object: esri/symbols/support/cimSymbolUtils
Since: ArcGIS API for JavaScript 4.16

Provides utility functions for CIMSymbols. These methods will allow you to get and set the size, color, and rotation of a CIMsymbol.

Method Overview

Name Return Type Summary Object
more details

Sets the color of the symbol layers of a CIMSymbol to a given value if the symbol layer is not color locked.

more detailscimSymbolUtils
more details

Sets the rotation value of a CIMSymbol.

more detailscimSymbolUtils
Colormore details

Returns the first color of the symbol layers in a CIMSymbol.

more detailscimSymbolUtils
Numbermore details

Returns the rotation value of a CIMSymbol.

more detailscimSymbolUtils
Numbermore details

Returns the size of a given CIMSymbol.

more detailscimSymbolUtils
more details

Scales the largest layer of a CIMSymbol to a given size.

more detailscimSymbolUtils

Method Details

applyCIMSymbolColor(symbol, color)

Sets the color of the symbol layers of a CIMSymbol to a given value if the symbol layer is not color locked.

Parameters:
symbol CIMSymbol

The CIMSymbol to set the color on.

color Color

The desired color value for the symbol.

applyCIMSymbolRotation(symbol, rotation, clockwise)

Sets the rotation value of a CIMSymbol.

Parameters:
symbol CIMSymbol

The CIMSymbol to set the rotation on.

rotation Number

The desired rotation of the symbol in degrees.

clockwise Boolean
optional

Indicates whether to rotate the symbol clockwise. Default is false.

getCIMSymbolColor(symbol){Color}

Returns the first color of the symbol layers in a CIMSymbol.

Parameter:
symbol CIMSymbol

The CIMSymbol from which to get the color.

Returns:
Type Description
Color Returns the color of the CIMSymbol.
getCIMSymbolRotation(symbol, clockwise){Number}

Returns the rotation value of a CIMSymbol.

Parameters:
symbol CIMSymbol

The CIMSymbol from which to get the rotation.

clockwise Boolean
optional

Indicates whether to get the rotation value as clockwise rotation. Default is false.

Returns:
Type Description
Number The rotation value of the symbol in degrees.
getCIMSymbolSize(symbol){Number}

Returns the size of a given CIMSymbol. The size of a CIMSymbol is defined as the size of the largest symbol layer.

Parameter:
symbol CIMSymbol

The CIMSymbol from which to get the size.

Returns:
Type Description
Number Returns the size of the symbol in pixels.
scaleCIMSymbolTo(symbol, size, scaleOptions)

Scales the largest layer of a CIMSymbol to a given size. The other symbol layers will scale accordingly.

Parameters:
symbol CIMSymbol

The CIMSymbol to scale.

size Number

The desired size for the symbol.

scaleOptions Object
optional

Options for scaling the symbol.

Specification:
preserveOutlineWidth Boolean
optional

When true, this property will preserve the outline width of the symbol. This property will only work when scaleSymbolsProportionally is false on the symbol layer. If scaleSymbolsProportionally is true, this property will be ignored.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.