require(["esri/symbols/support/cimSymbolUtils"], (cimSymbolUtils) => { /* code goes here */ });
import * as cimSymbolUtils from "@arcgis/core/symbols/support/cimSymbolUtils.js";
esri/symbols/support/cimSymbolUtils
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 | ||
Returns the first color of the symbol layers in a CIMSymbol. | cimSymbolUtils | ||
Returns the rotation value of a CIMSymbol. | cimSymbolUtils | ||
Returns the size of a given CIMSymbol. | cimSymbolUtils | ||
Scales the largest layer of a CIMSymbol to a given size. | cimSymbolUtils |
Method Details
-
Sets the color of the symbol layers of a CIMSymbol to a given value if the symbol layer is not color locked.
Parameterssymbol CIMSymbolThe CIMSymbol to set the color on.
color ColorThe desired color value for the symbol.
options ObjectoptionalSince 4.23 The options for setting the color of the CIMSymbol.
SpecificationlayersToColor StringoptionalThe 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"
-
Sets the rotation value of a CIMSymbol.
Parameters
-
getCIMSymbolSize
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.
Parametersymbol CIMSymbolThe CIMSymbol from which to get the size.
ReturnsType Description Number Returns the size of the symbol in pixels.
-
Scales the largest layer of a CIMSymbol to a given size. The other symbol layers will scale accordingly.
Parameterssymbol CIMSymbolThe CIMSymbol to scale.
size NumberThe desired size for the symbol.
options ObjectoptionalOptions for scaling the symbol.
SpecificationpreserveOutlineWidth BooleanoptionalWhen
true
, this property will preserve the outline width of the symbol. This property will only work whenscaleSymbolsProportionally
isfalse
on the symbol layer. IfscaleSymbolsProportionally
istrue
, this property will be ignored.