Select to view content in your preferred language

Clone CIM Symbol

369
2
Jump to solution
04-14-2023 06:16 AM
ADITYAKUMAR1
Occasional Contributor III

Hi,

 I am using CIM symbol for my maps. But I am not able to dynamically change the size of the symbol. I tried to clone the symbol using clone().

https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-CIMSymbol.html

let symLyr = myobject[0].symbol.clone();

But the above code is giving me undefined as output.

Any idea how to clone the CIM  symbol?

 

Thnaks

0 Kudos
1 Solution

Accepted Solutions
JohnGrayson
Esri Regular Contributor

You might also want to check out the cimSymbolUtils if you're looking to change the size of the symbol.  Maybe the scaleCIMSymbolTo() method will do what you need?

 

View solution in original post

0 Kudos
2 Replies
AnneFitz
Esri Regular Contributor

Hi @ADITYAKUMAR1 - You should be able to call clone() on your symbol after it's been initialized - here's an example: https://codepen.io/annefitz/pen/XWxdJvV (the clone method is called on line 278). Hope this helps!

0 Kudos
JohnGrayson
Esri Regular Contributor

You might also want to check out the cimSymbolUtils if you're looking to change the size of the symbol.  Maybe the scaleCIMSymbolTo() method will do what you need?

 

0 Kudos