Change markup colors within workflow
Is it possible to create markups based on user input geometries dynamically within workflows? I'm using AddMarkupGeometry successfully, but I don't if I can also control the color of the markup.
I'm rebuilding my mailing labels workflow and would like to add some more color feedback (location the user clicks, a buffer around the location, and the underlying parcels it selects). Ideally I'd like to make all three of those be different colors.
If it's not possible with markups, does anyone have any ideas for how to do it with other workflow methods? I know using HighlighEsriFeatureSet is an option, but I'm trying to avoid highlighting if possible since they'll get cleared out if the user clicks on the map during the workflow and opens a map tip, which runs the ClearHighlights command.
0
-
Hi John,
Totally possible to use the UpdateGraphicsLayer activity. Make as many layers as you want and then remove then when you are finished. This activity will give you full control to mark up the map how you wish.
-Kevin0 -
For the Renderer property in the UpdateGraphicsLayer activity, use something like this (example for blue points). New ESRI.ArcGIS.Client.SimpleRenderer With { .Symbol = New ESRI.ArcGIS.Client.Symbols.SimpleMarkerSymbol() With { .Color = New System.Windows.Media.SolidColorBrush() With { .Color = System.Windows.Media.Color.FromArgb(255, 0, 0, 255) }, .Size = 9 } }0 -
If I could choose two best answers, I would, thanks! This should be plenty to get me started. 0 -
Hi John,
How did you generate the unique layernames/layerids for the markups added with AddMarkupGeometry so that they can be passed to the UpdateGraphicsLayer activity?
Thank you,
Stephanie0 -
So AddMarkupGeometry and UpdateGraphics layers are two different things.
AddMarkupGeometry is an external command that will add a markup based on an input geometry (and uses the default markup settings of your viewer). The markup behaves like any other markup, i.e., you can use the drawing tools to edit, move, or erase it.
UpdateGraphicsLayer is a client activity that will add a graphic to your map based on an input feature set (and uses whatever color and style settings you pass to it using the Renderer argument).
You can have multiple graphics with multiple styles by using multiple activities with different Ids. For example, if you wanted to highlight selected parcels with one color and then show a buffer distance from them in another color, you would run two different UpdateGraphicsLayer activities with two different Graphics Layer Ids.
To replace or remove graphics, you have to run the UpdateGraphicsLayer activity again using the same Graphics Layer Id and with the Remove All Features argument set to true (you can redraw any existing graphic with a new feature set or leave the FeatureSet argument blank to remove the graphic).0 -
Thank you, John. I totally misunderstood the responses to your original post. I thought they were implying that the styles/renderes for your markups could be set using the Update Graphics Layer activity. I couldn't figure out how that was possible. Thank you for clarifying for me! 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
6 Kommentare