Select to view content in your preferred language

SimpleFillSymbol Outline Color

5493
5
Jump to solution
03-20-2012 10:25 AM
JamesVillanueva
Regular Contributor
When the SimpleFillSymbol is created as seen below:

var sfs = new esri.symbol.SimpleFillSymbol(style, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.SOLID, new dojo.Color("FFE01B6A"),2), new dojo.Color("FF1B1EE0"));

The outline color remains set to black. It should be set to blue. The color can be set manually after the SimpleFillSymbol is created:

sfs.outline.color = new dojo.Color("FF1B1EE0");


Is this a known issue?
0 Kudos
1 Solution

Accepted Solutions
derekswingley1
Deactivated User
When you specify your line symbol for your fill symbol, you need to specify a valid constant for style. esri.symbol.SimpleLineSymbol.SOLID is not valid. Try esri.symbol.SimpleLineSymbol.STYLE_SOLID. Alternatively, rather than the long name, you can specify a string, like "solid". Refer to the constants table here:  http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/simplelinesymbol.htm

Edit:  this post was in reference to one that was deleted...but this info is still relevant.

View solution in original post

0 Kudos
5 Replies
HemingZhu
Frequent Contributor
When the SimpleFillSymbol is created as seen below:

var sfs = new esri.symbol.SimpleFillSymbol(style, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.SOLID, new dojo.Color("FFE01B6A"),2), new dojo.Color("FF1B1EE0"));

The outline color remains set to black. It should be set to blue. The color can be set manually after the SimpleFillSymbol is created:

sfs.outline.color = new dojo.Color("FF1B1EE0");


Is this a known issue?


For dojo.Color construct, you either put RGB (or RGBA) -[R, G, B (, A)], or Hex string -#AABBCC, or Color Name -"White".
0 Kudos
derekswingley1
Deactivated User

sfs.outline.color = new dojo.Color("FF1B1EE0");


"FF1B1EE0" isn't valid input for dojo.Color. As Heming said, dojo.Color needs a string("white"), a hex string("#fff"), or an array of rgb or rgba values([255, 255, 255] or [255, 255, 255, 1]).
0 Kudos
JamesVillanueva
Regular Contributor
I tried your suggestion and it didn't work. The outline color rgb was still set to 0,0,0. I had to set the outline color on the SimpleFillSymbol after it was created in order to get it to set correctly.

What you said initially made sense,but the string was ingested and created the proper RGB within the dojo color object. The issue appears to be the ESRI SimpleFillSymbol constructor not setting the outline color properly.
0 Kudos
derekswingley1
Deactivated User
When you specify your line symbol for your fill symbol, you need to specify a valid constant for style. esri.symbol.SimpleLineSymbol.SOLID is not valid. Try esri.symbol.SimpleLineSymbol.STYLE_SOLID. Alternatively, rather than the long name, you can specify a string, like "solid". Refer to the constants table here:  http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/simplelinesymbol.htm

Edit:  this post was in reference to one that was deleted...but this info is still relevant.
0 Kudos
JamesVillanueva
Regular Contributor
Thanks for the help. That was the cause of the issue.
0 Kudos