Polygon Symbol from JSON won't render
I can't get graphics layer features to render using the 'Get Symbol from JSON' activity to create the symbol. The features are added, attributes correctly listed in the results pane and can be zoomed to etc. but they are just not drawn. Must be something silly, but I just can't see it...
The JSON is (from a site VirtualDirectory/Symbols/polygon/Outline.json, NB I have used a number of variations in style and also used JSON styles generated from the 'esri symbol playground' but they also did not work):
{
"name" : "Solid Outline Blue",
"color" : [76, 160, 216, 0],
"outline" : {
"color" : [76, 160, 216, 255],
"width" : 2.25,
"type" : "esriSLS",
"style" : "esriSLSSolid"
},
"type" : "esriSFS",
"style" : "esriSFSSolid"
}
The features then have a symbol attribute as follows (copied from the console log):
symbol:
color: b.Color {r: 76, g: 160, b: 216, a: 0}
name: "Solid Outline Blue"
outline: {color: b.Color, width: 3, type: "simplelinesymbol", style: "solid", marker: undefined, …}
style: "solid"
type: "simplefillsymbol"
How on earth have I managed to muck this up?
Thanks!
-
Hi David,
Your symbol JSON actually worked fine for me when I tried it. Try importing the attached file in workflow designer, saving, and then running it in the sandbox.
Some differences to check for-
- is your geometry that you're using a valid polygon symbol, with the same spatial reference as the viewer?
- did you add an = sign in front of your symbol json? I was recently discussing an issue like that with Chris here https://communities.geocortex.com/s/question/0D5f200005YyIPkCAN/should-addmarkup-work-like-it-does-in-essentials
- are you missing a property path in the other activities that the symbol gets passed to? Eg, using =$symbolfromjson1 instead of =$symbolfromjson1.symbol
0 -
Hi @Amanda Frech? ,
Thanks very much for your reply, great suggestions. your example worked for me in the sandbox, but my workflow is still in distress...!
- Geometry looks valid in the console log, can be zoomed to and looks like location all good.
- tried with and without the =, tried " and ' variants. The symbol itself seems to be created properly going by the symbol attribute logged in the console
- Pretty sure I feed in symbol1.symbol to the 'set feature symbol' activity
Hoping it's an easy way for you to take a quick look, I have uploded a short video showing the pertinant workflow design elements and also the workflow execution with some console exploration.
I'd be really happy if you had any further ideas, must be something stupidly simple but I've spent a day poring over this and I'm missing it!!!
Thanks!
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
2 kommentarer