Currently I can construct the point symbol through SymbolFactory.Instance.ConstructPointSymbol() Method and set SimpleMarkerStyle to create the simple marker. But after creating, I need to get the marker style (circle, rectangle, cross, etc) of the point symbol. I wonder if there is any corresponding property for it.
Thank you very much.
Hi Dominic
Check out the ConstructMarker method - It has a few overloads that might be what you are looking for.
This one gives you a marker directly by passing in SimpleMarkerStyle:
<SPAN class="keyword token">public</SPAN> CIMMarker <SPAN class="token function">ConstructMarker</SPAN><SPAN class="punctuation token">(</SPAN> CIMColor color<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">double</SPAN> size<SPAN class="punctuation token">,</SPAN> SimpleMarkerStyle markerStyle <SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Thanks
Uma
Hi Uma,
Thanks for your reply. I can use this method to construct a simple marker with specific style. But I need to get the style property later on -- after I create the symbol object. Currently I cannot find the corresponding property from CIMPointSymbol or CIMVectorMarker. Can you give me ideas? Thank you very much.
Best,
Dominic
The marker used to create the point symbol is stored inside the point symbol as a symbol layer.
You could get it like this:
<SPAN class="keyword token">var</SPAN> pointSymbol <SPAN class="operator token">=</SPAN> SymbolFactory<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ConstructPointSymbol</SPAN><SPAN class="punctuation token">(</SPAN>ColorFactory<SPAN class="punctuation token">.</SPAN>Instance<SPAN class="punctuation token">.</SPAN>GreenRGB<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">10.0</SPAN><SPAN class="punctuation token">,</SPAN> SimpleMarkerStyle<SPAN class="punctuation token">.</SPAN>Diamond<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">var</SPAN> marker <SPAN class="operator token">=</SPAN> pointSymbol<SPAN class="punctuation token">.</SPAN>SymbolLayers<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN> <SPAN class="keyword token">as</SPAN> CIMVectorMarker<SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.