Hide Table of Contents
esri
Map
toolbars
Class: FillSymbol
[ AMD Module Require | Legacy Module Require ]

Module Require

require(["esri/symbols/FillSymbol", ... ], function(FillSymbol, ... ){ ... });

Description

Fill symbols are used to draw polygon features on the graphics layer. Fills can be specified as solid, hatched, or pictures. In addition, the symbol can have an optional outline, which is defined by a line symbol.

FillSymbol has no constructor. Use SimpleFillSymbol or PictureFillSymbol.

Samples

Search for samples that use this class.

Class hierarchy

esri.symbol.Symbol
|_esri.symbol.FillSymbol

Subclasses

SimpleFillSymbol  PictureFillSymbol

Properties

PropertyTypeDescription
colordojo.ColorSymbol color, which is based on dojo.Color. Colors can be denoted in the following formats:

  • R, G, B: new dojo.Color([255,0,0])
  • R,G,B,A. The "A" value represents transparency where 0.0 is fully transparent and 1.0 has no transparency: new dojo.Color([255,0,0,0.25])
  • Hex string: new dojo.Color("#C0C0C0")
  • Named string: new dojo.Color("blue")
outlineSimpleLineSymbolOutline of the polygon.
typeStringThe type of symbol.

Methods

MethodReturn ValueDescription
setColor(color)SymbolSets the symbol color.
setOutline(outline)FillSymbolSets the outline of the fill symbol.
toJson()ObjectConverts object to its ArcGIS Server JSON representation.
Property Details

<dojo.Color> color

Symbol color, which is based on dojo.Color. Colors can be denoted in the following formats:

  • R, G, B: new dojo.Color([255,0,0])
  • R,G,B,A. The "A" value represents transparency where 0.0 is fully transparent and 1.0 has no transparency: new dojo.Color([255,0,0,0.25])
  • Hex string: new dojo.Color("#C0C0C0")
  • Named string: new dojo.Color("blue")
Outline of the polygon.

<String> type

The type of symbol.
Known Values: simplemarkersymbol | picturemarkersymbol | simplelinesymbol | cartographiclinesymbol | simplefillsymbol | picturefillsymbol | textsymbol
Method Details

setColor(color)

Sets the symbol color.
Return Value: Symbol
Input Parameters:
<dojo.Color> colorRequiredColors can be denoted in the following formats:

  • R, G, B: new dojo.Color([255,0,0])
  • R,G,B,A. The "A" value represents transparency where 0.0 is fully transparent and 1.0 has no transparency: new dojo.Color([255,0,0,0.25])
  • Hex string: new dojo.Color("#C0C0C0")
  • Named string: new dojo.Color("blue")
Code Snippet:
require([
  "dojo/_base/Color", ... 
], function(Color, ... ) {
  symbol.setColor(new Color([255,255,0,0.5]));
  ...
});

setOutline(outline)

Sets the outline of the fill symbol.
Return Value: FillSymbol
Input Parameters:
<SimpleLineSymbol> outlineRequiredSymbol used for outline.
Code Snippet:
require([
  "esri/symbols/SimpleLineSymbol", "dojo/_base/Color", ... 
], function(SimpleLineSymbol, Color, ... ) {
  selSymbol.setOutline(new SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new Color([255,0,0]), 2));   
  ...
});

toJson()

Converts object to its ArcGIS Server JSON representation.
Return Value: Object