I am attempting to set a custom definition on a map. I want to use a single feature as the clipping shape. The single feature is its own layer. I am trying to use the definition.CustomClippingShapeURI to set the shape and then setTheDefinition. As you can see below I am using a string for the URI. I got this string after using console to capture the URI using the layer before. "In other words this is how the URI is returned if I define it as a path. This doesn't work though.
If I set ClippingMode to ClippingMode.MapExtent that works as it should.
<SPAN class="keyword token">var</SPAN> jw3 <SPAN class="operator token">=</SPAN> mapFrameMap<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetDefinition</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
jw3<SPAN class="punctuation token">.</SPAN>ClippingMode <SPAN class="operator token">=</SPAN> ClippingMode<SPAN class="punctuation token">.</SPAN>CustomShape<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> lyrOfInterest <SPAN class="operator token">=</SPAN> mapFrameMap<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayersAsFlattenedList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>OfType<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
jw3<SPAN class="punctuation token">.</SPAN>CustomClippingShapeURI <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Assessor Map/JWtest"</SPAN><SPAN class="punctuation token">;</SPAN>
mapFrameMap<SPAN class="punctuation token">.</SPAN><SPAN class="token function">SetDefinition</SPAN><SPAN class="punctuation token">(</SPAN>jw3<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
I have also tried.
<SPAN class="keyword token">var</SPAN> lyrOfInterest <SPAN class="operator token">=</SPAN> mapFrameMap<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetLayersAsFlattenedList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>OfType<SPAN class="operator token"><</SPAN>FeatureLayer<SPAN class="operator token">></SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> jw3 <SPAN class="operator token">=</SPAN> mapFrameMap<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetDefinition</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
CIMClippingPath path1 <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">CIMClippingPath</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
path1<SPAN class="punctuation token">.</SPAN>Path <SPAN class="operator token">=</SPAN> lyrOfInterest<SPAN class="punctuation token">.</SPAN>URI<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ToString</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">;</SPAN>
jw3<SPAN class="punctuation token">.</SPAN>ClippingMode <SPAN class="operator token">=</SPAN> ClippingMode<SPAN class="punctuation token">.</SPAN>CustomShape<SPAN class="punctuation token">;</SPAN>
jw3<SPAN class="punctuation token">.</SPAN>CustomClippingShapeURI <SPAN class="operator token">=</SPAN> path1<SPAN class="punctuation token">;</SPAN>
MessageBox<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Show</SPAN><SPAN class="punctuation token">(</SPAN>jw3<SPAN class="punctuation token">.</SPAN>CustomClippingShapeURI<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ToString</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
mapFrameMap<SPAN class="punctuation token">.</SPAN><SPAN class="token function">SetDefinition</SPAN><SPAN class="punctuation token">(</SPAN>jw3<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
This does not work either. Does anybody know how to properly use the CustomShapeURI mode??
Wolfgang Kaiser Uma Harano Charles Macleod - Do any of you have suggestions for using CustomClippingshapeURI for ClippingMode on the map?