Select to view content in your preferred language

LineSymbol outline

955
6
Jump to solution
08-19-2020 11:52 AM
LefterisKoumis
Regular Contributor II

I read in geonet that:

"In version 3.X of the API you could specify the outline color separately from the inner color, but I the 4.X LineSymbol does not have that property. "

So, in 3.x how would you modify/add the below to add a black outline.

sfs = new SimpleRenderer(new SimpleLineSymbol(
                SimpleLineSymbol.STYLE_SOLID,
                new Color([255, 236, 176, 3]),
                5)
              )‍‍‍‍‍

Thanks,.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

No Two Graphics with the different line weights

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

   Not sure where you read that. In either API there is no property for defining an outline color of a line.

See my workaround response in this thread

https://community.esri.com/thread/184769-red-line-with-black-outline-in-javascript-api 

0 Kudos
LefterisKoumis
Regular Contributor II

ok Thanks.

I  read the posting at geonet at a number of places like at:

https://community.esri.com/thread/231763-simplelinesymbol-with-line-border 

Read the last response.

0 Kudos
LefterisKoumis
Regular Contributor II

Did you mean something like this. IT seems that only the first linesymbol is drawn.

sfs = new SimpleRenderer(new SimpleLineSymbol(
                SimpleLineSymbol.STYLE_SOLID,
                new Color([255, 236, 176]),
                3),
                new SimpleLineSymbol(
                  SimpleLineSymbol.STYLE_SOLID,
                  new Color([0, 0, 0]),
                  5)
              )
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

No Two Graphics with the different line weights

0 Kudos
LefterisKoumis
Regular Contributor II

ok Got it. In my case is a bit  more work because I am using the featurelayer.setRenderer. I don't assign the symbol on each feature.

So I do need an extra fL with the second color.

Then I have to make sure that layerlist and legend don't list the extra fL.

Thanks.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

That is a good workaround if you really need this two color line. You will also have to consider how to turn both layers off when the user set one of the layer to not be visible.

0 Kudos