cimSymbolUtils

AMD: require(["esri/symbols/support/cimSymbolUtils"], (cimSymbolUtils) => { /* code goes here */ });
ESM: import * as cimSymbolUtils from "@arcgis/core/symbols/support/cimSymbolUtils.js";
Object: esri/symbols/support/cimSymbolUtils
Since: ArcGIS Maps SDK 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

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

cimSymbolUtils

Sets the rotation value of a CIMSymbol.

cimSymbolUtils
Color

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

cimSymbolUtils
Number

Returns the rotation value of a CIMSymbol.

cimSymbolUtils
Number

Returns the size of a given CIMSymbol.

cimSymbolUtils

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

cimSymbolUtils

Method Details

applyCIMSymbolColor

Method
applyCIMSymbolColor(symbol, color, options)

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.

options Object
optional

Since 4.23 The options for setting the color of the CIMSymbol.

Specification
layersToColor String
optional

The symbol layers to apply the color to. This only applies to CIMPolygonSymbols and CIMPointSymbols with embedded polygon marker graphics. The "fill" option will only apply the color to the fill symbol layers - CIMSolidFill, CIMHatchFill, CIMPictureFill, etc. The "outline" option will only apply the color to the stroke symbol layers - like CIMSolidStroke and CIMPictureStroke. The "fill-and-outline" option will apply the color to both fill and stroke layers. The default value is "fill".

Possible Values:"fill"|"outline"|"fill-and-outline"

applyCIMSymbolRotation

Method
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

Method
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

Method
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

Method
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

Method
scaleCIMSymbolTo(symbol, size, options)

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.

options 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.