UpdateGraphicsLayer - How to use the JSON Renderer
What is the magic formula for entering the JSON renderer string from the Symbol Playground into the UpdateGraphicsLayer activity? I can't seem to make Workflow Designer happy with anything I enter. It wants some sort of "ending" that I can't provide. Here's what I'm putting in for the Renderer:
ESRI.ArcGIS.Client.Renderer.FromJson("{"type": "esriSFS","color": [168,0,0,64],"outline": {"type": "esriSLS","color": [115,0,0,255],"width": 2,"style": "esriSLSSolid" },"style": "esriSFSSolid"}")
The workflow designer complains that it wants:
Comma, ')', or a valid continuation expression expected
The JSON Formatter-Validator web page says the string I'm adding is valid JSON. What do I need to do to make this happy?
0
-
This? ESRI.ArcGIS.Client.Renderer.FromJson("{'type': 'esriSFS','color': [168,0,0,64],'outline': {'type': 'esriSLS','color': [115,0,0,255],'width': 2,'style': 'esriSLSSolid' },'style': 'esriSFSSolid'}")0 -
It compiles, but it doesn't render anything. 0 -
Hi Sean,
you can try this instead:
ESRI.ArcGIS.Client.Renderer.FromJson("{'type':'simple','symbol':{'type': 'esriSFS','color': [168,0,0,64],'outline': {'type': 'esriSLS','color': [115,0,0,255],'width': 2,'style': 'esriSLSSolid' },'style': 'esriSFSSolid'}}")
It is quite finicky. The 'type' needs to be specified - in this case 'simple'. Also, the items are in single quotes as the double quotes are used for ESRI.ArcGIS.Client.Renderer.FromJson("..
I hope that works,
Marion.0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare