JSON format diagonal fill symbol not the right color?

3785
7
Jump to solution
12-03-2015 12:43 PM
TracySchloss
Frequent Contributor

I have used the JSON format successfully for symbology in the past, but this is the first time I've used something besides solid or null for the fill.  For this project I wanted a diagonal line.  I  defined it in JSON format as

var myfill = new SimpleFillSymbol({

        "type": "esriSFS",

        "style": "esriSFSForwardDiagonal",

        "color": [255, 0, 0, 255],

        "outline": {

          "type": "esriSLS",

          "style": "esriSLSSolid",

          "color": [255, 0, 0, 130],

          "width": 3

        }

      })

diagolSym.png

I expected the diagonal lines to be red, but they are black.  The red outline is correct.  I've tried 3.14 and 3.15 and got the same results.

What gives?  I'm following the syntax for symbol objects found in ArcGIS REST API

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Tracy,

   Right from the docs:

Symbol color - only applies when SimpleFillSymbol.style = 'STYLE_SOLID'.

View solution in original post

7 Replies
RobertScheitlin__GISP
MVP Emeritus

Tracy,

   Right from the docs:

Symbol color - only applies when SimpleFillSymbol.style = 'STYLE_SOLID'.

TracySchloss
Frequent Contributor

I don't see that it's mentioned on the link I sent.  I didn't cross check it against the API reference, because the API reference often tells you to find the JSON format off the REST help. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Tracy,

   Here is the link to the JS API reference:

SimpleFillSymbol | API Reference | ArcGIS API for JavaScript | Color

0 Kudos
KenBuja
MVP Esteemed Contributor
0 Kudos
TracySchloss
Frequent Contributor

It doesn't seem that complicated for ESRI to fix.  I'll have to decide which I'd rather see - red or the cross hatching.

0 Kudos
MiriamBrockmann
Occasional Contributor

Hello Tracy!

Strange enough i find a way to manage this. At the Moment we change the way, how we

produce PDFs. With a lot of testing and programming I inserted the PrintTask widget.

While Testing our Drawingtool, not expecting anything has changed with the Fillcolor, i make some Testprintouts and there it shoes that the Fillcolour of the screen is still black, but in the Printouts the chosen color is used.

I don't know why this is possible in the printouts and not on screen but for us it's enough.

Area how it looks on screen ( Filling should be red )

and how it looks in the Printout

Maybe this solution helps.

Regards, Miriam

0 Kudos
JoshOng
New Contributor II

Don't know if any of you still want this capability, but one solution is to use a PictureFillSymbol with a graphic having the appropriate repeating diagonal color lines.  You just have to make sure they are aligned so that when it repeats it lines up on both edges.  It's not perfect, but it gets the effect.  I haven't tried it but you can probably use a PNG with transparency if you want lines with gaps.

0 Kudos