Export Map Service with Dynamic Map Layer example
Hi all,
I'm trying to use the Export Map Service activity with Dynamic Map Layers and Layer Definitions and Layer Drawing Options and all that. Unfortunately I am so far unsuccesful, I keep running into errors (mostly "The calling thread cannot access this object because a different thread owns it").
Since I can't seem to figure it out, I am looking for an example on how these options are used in this activity.
Kind regards,
Rik
0
-
Hi Rik,
I recommend wrapping your entire operation in a Server Scope activity to ensure that the objects you're creating to export the map image are never serialized, and then set the object scope for the DynamicLayerInfos (etc) to be within the Server Scope activity.
The Esri WPF objects that are used to represent layers create user-mode graphics contexts that cannot be serialized or managed by other threads. So, when Workflow tries to send data to the client (for a display form or alert activity), Essentials will try to manage those objects with a different thread and we encounter this error. To avoid it, we can contain all of the export activities in a Server Scope. You can expose a string or byte array variable outside your server scope to retain the image (either with a path, or with the resulting bytes)
Regards,
-Malcolm0 -
Hi Melcolm,
Any chance you can provide a sample of what the syntax should look like for the 'LayerDefinitions' inside the ExportMapService Activity?
I can successfully export an image at the rest end point, however when i have tried to convert the sytax to use in my workflow, it will not except it. I have tried looking through the help docs and in the forum, however do not see any responses. Here is what I know and have tried using.
layerDefinitions="{1:{"11" :"id in '4413251'"}}"
I have tried may different combos but cant seem to get the activity to even accept the syntax. Any information you can provide me with would be greatly apprecited.
Thank you0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare