Hi,
I'm trying to use dynamic data layers in ArcGIS Server REST to replace the datasource for a layer in a mapservice when making a request to the /export method. What happens is that for certain users, instead of the original featureclass, a view is used in order to limit what they see on the map. This already works.
However, when using a dataLayer object, I'm forced to also provide a drawingInfo object that specifies the symbology. But this particular mapservice uses some complicated symbols that cannot be reproduced by the renderer in the drawingInfo.
I was wondering if there is a way to tell ArcGIS Server to use the renderer from an existing mapLayer in the service, and only replace the datasource being used.
I also noticed there is something called a workspaceLayer that can be used when the service is published by ArcGIS Pro, and which references a .lyrx file. So far I haven't been able to get the proper syntax. For example, setting dynamicLayers to
<SPAN class="punctuation token">[</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"id"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"source"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"type"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"workspaceLayer"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"workspaceId"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"TEST_WS"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"layerId"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"layerfile.lyrx"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<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>gives me: 'Unable to create workspaceLayer with invalid 'layerId' input.'