Renderer documentation
Can someone please point me to documentation and examples of syntax for the creating renderers in a workflow? For example: New ESRI.ArcGIS.Client.SimpleRenderer() With { .Symbol = new ESRI.ArcGIS.Client.Symbols.SimpleFillSymbol() With { .BorderBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Cyan), .BorderThickness = 1.0, .Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Cyan) With { .Opacity = 0.5 } } }
In addition, the expression editor is so hard to use for this. Is there some trick I don't know about? I've been editing in Notepad and copying into editor which is not always successful and obviously no intellisense.
Thanks so much.
0
-
Check e.g. http://help.arcgis.com/en/webapi/wpf/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.SimpleRenderer.html for documentation on ESRI.ArcGIS.Client.SimpleRenderer.
You have enabled intellisense and are using the expression editor (use the button with the three dots to the right of the Renderer property in the Properties window on the right side of the screen)?0 -
Thank you for you answer Nico. The link only shows a simple object model and doesn't even list properties. Even digging down into symbol is not very helpful. I'd really like a few examples of the syntax - the only place I can find one now is in the example workflows - and these are not a bad place to start. Yes, I am using the expression editor but it shows everything on one long line which is very hard to edit with the wordy syntax required to define a symbol. I could've sworn I once saw some examples in the workflow help section and I think once there was a default symbol definition that was created but I can't find either of these again. Thanks. 0 -
I know this string is a bit old, but I totally agree. It would be really nice to have a bigger library of symbol examples (simple and json) to be able to borrow from. It seems the renderer string is so finicky it can become a massive time-sink (at least for me anyway...) 0 -
Hi Jesse,
I was going to explain the process I use when I want more customized symbols, but I realized there was a lot of steps in Notepad using Find/Replace and removing new lines and spaces. So instead, I set up a workflow.- Copy the text from the next post below this one
- In Workflow Designer, use File > New > From Clipboard
- Run the workflow in the simulator
- Follow the steps on the form. It'll direct you to use this helpful Esri site to get symbol json: https://developers.arcgis.com/javascript/latest/sample-code/playground/live/index.html . Then it'll assemble the renderer expression from that.
0 -
<Activity mc:Ignorable="sap sap2010 sads" x:Class="ActivityBuilder" mva:VisualBasic.Settings="{x:Null}" sap2010:WorkflowViewState.IdRef="ActivityBuilder_1"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:eac="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
xmlns:eacg="clr-namespace:ESRI.ArcGIS.Client.Geometry;assembly=ESRI.ArcGIS.Client"
xmlns:eact="clr-namespace:ESRI.ArcGIS.Client.Tasks;assembly=ESRI.ArcGIS.Client"
xmlns:gce="clr-namespace:Geocortex.Core.Extensions;assembly=Geocortex.Core"
xmlns:gcx="http://apis.geocortex.com/2009"
xmlns:gfc="clr-namespace:Geocortex.Forms.Client;assembly=Geocortex.EssentialsWpfApi"
xmlns:gfci="clr-namespace:Geocortex.Forms.Client.Items;assembly=Geocortex.EssentialsWpfApi"
xmlns:gr="clr-namespace:Geocortex.Reporting;assembly=Geocortex.Reporting"
xmlns:gwa="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow"
xmlns:gwa1="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow.Activities"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:s="clr-namespace:System;assembly=System.Core"
xmlns:s1="clr-namespace:System;assembly=System"
xmlns:s2="clr-namespace:System;assembly=mscorlib"
xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
xmlns:sl="clr-namespace:System.Linq;assembly=System.Core"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>ESRI.ArcGIS.Client</x:String>
<x:String>ESRI.ArcGIS.Client.Geometry</x:String>
<x:String>ESRI.ArcGIS.Client.Tasks</x:String>
<x:String>Geocortex.Core.Extensions</x:String>
<x:String>Geocortex.Workflow.Activities</x:String>
<x:String>Geocortex.Forms.Client</x:String>
<x:String>Geocortex.Forms.Client.Items</x:String>
<x:String>Geocortex.Reporting</x:String>
<x:String>System</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Windows.Markup</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>ESRI.ArcGIS.Client</AssemblyReference>
<AssemblyReference>Geocortex.Core</AssemblyReference>
<AssemblyReference>Geocortex.Workflow</AssemblyReference>
<AssemblyReference>Geocortex.EssentialsWpfApi</AssemblyReference>
<AssemblyReference>Geocortex.Reporting</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.Runtime.WindowsRuntime</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<Sequence sap2010:WorkflowViewState.IdRef="Sequence_2" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
<Sequence.Variables>
<Variable x:TypeArguments="x:String" Name="userSymbolJson" />
</Sequence.Variables>0 -
<gwa1:DisplayForm FormDefinition="<FormDefinition xmlns="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ContainerFormItem xmlns:a="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client.Items"><a:ArgumentName/><a:IsVisible>true</a:IsVisible><a:ItemID>Group1</a:ItemID><a:ToolTip/><a:ValidationItems xmlns:b="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client.Items.Validation"/><a:Description>Instructions:&#xD;
1. Go to Esri's Symbol Playground (https://developers.arcgis.com/javascript/latest/sample-code/playground/live/index.html)&#xD;
2. Select one of the simple symbols&#xD;
--SimpleMarkerSymbol for POINTS&#xD;
--SimpleLineSymbol for LINES&#xD;
--SimpleFillSymbol for POLYGONS&#xD;
3. Customize your symbol with the UI provided&#xD;
4. In the bottom panel of the symbol playground, click the { } button for json&#xD;
5. Copy the json from the panel&#xD;
6. Paste it in the form here and click Get Renderer</a:Description><a:FormItems><a:FormItem i:type="a:HyperlinkFormItem"><a:ArgumentName/><a:IsVisible>true</a:IsVisible><a:ItemID>Hyperlink1</a:ItemID><a:ToolTip/><a:ValidationItems xmlns:b="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client.Items.Validation"/><a:HyperlinkText>Link to Symbol Playground Site</a:HyperlinkText><a:Target>_blank</a:Target><a:Uri>https://developers.arcgis.com/javascript/latest/sample-code/playground/live/index.html</a:Uri></a:FormItem><a:FormItem i:type="a:TextAreaFormItem"><a:ArgumentName>argTextArea</a:ArgumentName><a:IsVisible>true</a:IsVisible><a:ItemID>TextArea1</a:ItemID><a:ToolTip/><a:ValidationItems xmlns:b="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client.Items.Validation"/><a:DefaultText/><a:InputScope>Default</a:InputScope><a:Label><a:ArgumentName/><a:IsVisible>true</a:IsVisible><a:ItemID/><a:ToolTip/><a:ValidationItems xmlns:b="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client.Items.Validation"/><a:LabelForItemID>TextArea1</a:LabelForItemID><a:Text/></a:Label><a:ReadOnly>false</a:ReadOnly><a:TextboxWidth>400</a:TextboxWidth><a:TextboxHeight>300</a:TextboxHeight></a:FormItem></a:FormItems><a:MaxWidth>INF</a:MaxWidth><a:Orientation>Vertical</a:Orientation><a:VisibleControlID i:nil="true"/><a:VisibleControlValue i:nil="true"/></ContainerFormItem><KnownTypes xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><a:string>Geocortex.Forms.Client.Items.ContainerFormItem</a:string><a:string>Geocortex.Forms.Client.Items.HyperlinkFormItem</a:string><a:string>Geocortex.Forms.Client.Items.TextAreaFormItem</a:string></KnownTypes><MaxHeight>800</MaxHeight><MaxWidth>1000</MaxWidth><Title>Symbol</Title><Version>1.1</Version></FormDefinition>" sap2010:WorkflowViewState.IdRef="DisplayForm_1">
<gwa1:DisplayForm.Body>
<ActivityAction x:TypeArguments="gcx:FormDefinition">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="gcx:FormDefinition" Name="form" />
</ActivityAction.Argument>
<Sequence DisplayName="RuntimeModifications" sap2010:WorkflowViewState.IdRef="Sequence_1" />
</ActivityAction>
</gwa1:DisplayForm.Body>
<gwa1:DisplayForm.Buttons>
<gcx:FormButton CausesValidation="False" IsDefault="False" Label="Get Renderer" Value="Value" />
</gwa1:DisplayForm.Buttons>
<gwa1:DisplayForm.FormOutArguments>
<gwa:ArgumentWrapper x:TypeArguments="OutArgument" IsRequired="False" Name="argTextArea">
<gwa:ArgumentWrapper.Argument>
<OutArgument x:TypeArguments="x:String">[userSymbolJson]</OutArgument>
</gwa:ArgumentWrapper.Argument>
</gwa:ArgumentWrapper>
</gwa1:DisplayForm.FormOutArguments>
</gwa1:DisplayForm>0 -
<Assign sap2010:WorkflowViewState.IdRef="Assign_1">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[userSymbolJson]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[userSymbolJson.replace(Environment.NewLine,"")]</InArgument>
</Assign.Value>
</Assign>
<Assign sap2010:WorkflowViewState.IdRef="Assign_3">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[userSymbolJson]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[userSymbolJson.replace("""","""""")]</InArgument>
</Assign.Value>
</Assign>
<Assign sap2010:WorkflowViewState.IdRef="Assign_4">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[userSymbolJson]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[userSymbolJson.replace(" ","")]</InArgument>
</Assign.Value>
</Assign>
<gwa1:DisplayForm FormDefinition="<FormDefinition xmlns="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ContainerFormItem xmlns:a="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client.Items"><a:ArgumentName/><a:IsVisible>true</a:IsVisible><a:ItemID>Group1</a:ItemID><a:ToolTip/><a:ValidationItems xmlns:b="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client.Items.Validation"/><a:Description>Paste this for the renderer in your Update Graphics Layer activity:</a:Description><a:FormItems><a:FormItem i:type="a:TextAreaFormItem"><a:ArgumentName/><a:IsVisible>true</a:IsVisible><a:ItemID>TextArea1</a:ItemID><a:ToolTip/><a:ValidationItems xmlns:b="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client.Items.Validation"/><a:DefaultText/><a:InputScope>Default</a:InputScope><a:Label><a:ArgumentName/><a:IsVisible>true</a:IsVisible><a:ItemID/><a:ToolTip/><a:ValidationItems xmlns:b="http://schemas.datacontract.org/2004/07/Geocortex.Forms.Client.Items.Validation"/><a:LabelForItemID>TextArea1</a:LabelForItemID><a:Text/></a:Label><a:ReadOnly>false</a:ReadOnly><a:TextboxWidth>500</a:TextboxWidth><a:TextboxHeight>200</a:TextboxHeight></a:FormItem></a:FormItems><a:MaxWidth>INF</a:MaxWidth><a:Orientation>Vertical</a:Orientation><a:VisibleControlID i:nil="true"/><a:VisibleControlValue i:nil="true"/></ContainerFormItem><KnownTypes xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><a:string>Geocortex.Forms.Client.Items.ContainerFormItem</a:string><a:string>Geocortex.Forms.Client.Items.TextAreaFormItem</a:string></KnownTypes><MaxHeight>800</MaxHeight><MaxWidth>1000</MaxWidth><Title>Renderer</Title><Version>1.1</Version></FormDefinition>" sap2010:WorkflowViewState.IdRef="DisplayForm_2">
<gwa1:DisplayForm.Body>
<ActivityAction x:TypeArguments="gcx:FormDefinition">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="gcx:FormDefinition" Name="form" />
</ActivityAction.Argument>
<Sequence DisplayName="RuntimeModifications" sap2010:WorkflowViewState.IdRef="Sequence_3">
<Assign sap2010:WorkflowViewState.IdRef="Assign_2">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[form.Find(Of TextAreaFormItem)("TextArea1").DefaultText]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">["ESRI.ArcGIS.Client.Renderer.FromJson(""{""""type"""":""""simple"""",""""symbol"""":" + userSymbolJson + "}"")"]</InArgument>
</Assign.Value>
</Assign>
</Sequence>
</ActivityAction>
</gwa1:DisplayForm.Body>
</gwa1:DisplayForm>0 -
<sads:DebugSymbol.Symbol>d3hDOlxQcm9ncmFtIEZpbGVzICh4ODYpXExhdGl0dWRlIEdlb2dyYXBoaWNzXEdlb2NvcnRleCBFc3NlbnRpYWxzXERlZmF1bHRcUkVTVCBFbGVtZW50c1xTaXRlc1xPY3QxNFxHZW5lcmF0ZVJlbmRlcmVyLnhhbWwUQgOGAQ4CAQFGBVkYAgEXWgVhDgIBE2IFaQ4CAQ5qBXEOAgEJcgWEARgCAQJVNVVFAgEaRiZG7BoCARlMC0xnAgEYXzBfYAIBFlwxXEECARRnMGdVAgERZDFkQQIBD28wb1ACAQxsMWxBAgEKciZyxBECAQh4C4EBFgIBA3kNgAEWAgEEfjh+qQECAQZ7OXtyAgEF</sads:DebugSymbol.Symbol>
</Sequence>
<sap2010:WorkflowViewState.ViewStateManager>
<sap2010:ViewStateManager>
<sap2010:ViewStateData Id="Sequence_1" sap:VirtualizedContainerService.HintSize="200,51">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="DisplayForm_1" sap:VirtualizedContainerService.HintSize="724,939" />
<sap2010:ViewStateData Id="Assign_1" sap:VirtualizedContainerService.HintSize="724,60" />
<sap2010:ViewStateData Id="Assign_3" sap:VirtualizedContainerService.HintSize="724,60" />
<sap2010:ViewStateData Id="Assign_4" sap:VirtualizedContainerService.HintSize="724,60" />
<sap2010:ViewStateData Id="Assign_2" sap:VirtualizedContainerService.HintSize="242,60" />
<sap2010:ViewStateData Id="Sequence_3" sap:VirtualizedContainerService.HintSize="264,184">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="DisplayForm_2" sap:VirtualizedContainerService.HintSize="724,735" />
<sap2010:ViewStateData Id="Sequence_2" sap:VirtualizedContainerService.HintSize="746,2138">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="ActivityBuilder_1" sap:VirtualizedContainerService.HintSize="786,2218" />
</sap2010:ViewStateManager>
</sap2010:WorkflowViewState.ViewStateManager>
</Activity>0 -
Sorry, it didn't end up fitting all in one post at all! You'll have to copy/assemble the 4 posts in Notepad (in order), then either copy the whole thing and use File > New > From Clipboard in Workflow Designer, or save the notepad as a .xaml. 0 -
Amanda,
That worked really and and was very helpful, thank you! I see now why I've been having issues with the json renderer and proper use of quotes.0
Please sign in to leave a comment.
Comments
10 comments