Class: SimpleFillSymbolE-mail This Topic Printable Version Give Us Feedback

Description

Fill symbols are used to draw polygon features on the graphics layer. SimpleFillSymbol can be solid, transparent, or one of several cross hatch patterns. In addition, the symbol can have an optional outline, which is defined by a line symbol.

Known limitation: When using FireFox 2.x, only STYLE_SOLID and STYLE_NULL are valid. All fill styles work correctly in Internet Explorer 6 and 7 and FireFox 3.x.

Class hierarchy

esri.symbol.Symbol
  |_ esri.symbol.FillSymbol
        |_ esri.symbol.SimpleFillSymbol

Constructor

Constructor Description
esri.symbol.SimpleFillSymbol() Creates a new empty SimpleFillSymbol object.
esri.symbol.SimpleFillSymbol(json) Creates a new SimpleFillSymbol object using a JSON object.
esri.symbol.SimpleFillSymbol(style, outline, color) Creates a new SimpleFillSymbol object with parameters.

Properties

Property Type Description
style String The fill style. See the Constants table for valid values. The default value is STYLE_SOLID. Color is valid only with STYLE_SOLID.

Constants

Constant Description
STYLE_BACKWARD_DIAGONAL The fill is backward diagonal lines.
STYLE_CROSS The fill is a cross.
STYLE_DIAGONAL_CROSS The fill is a diagonal cross.
STYLE_FORWARD_DIAGONAL The fill is forward diagonal lines.
STYLE_HORIZONTAL The fill is horizontal lines.
STYLE_NULL The polygon has no fill.
STYLE_SOLID The fill is solid.
STYLE_VERTICAL The fill is vertical lines.

Methods

Method Return Value Description
setStyle(style) SimpleFillSymbol Sets the fill symbol style.
Constructor Detail

esri.symbol.SimpleFillSymbol()

Creates a new empty SimpleFillSymbol object.
Code snippets:
new esri.symbol.SimpleFillSymbol();

esri.symbol.SimpleFillSymbol(json)

Creates a new SimpleFillSymbol object using a JSON object.
Parameters:
<Object> json Required JSON object representing the SimpleFillSymbol.

esri.symbol.SimpleFillSymbol(style, outline, color)

Creates a new SimpleFillSymbol object with parameters.
Parameters:
<String> style Required See Constants table for values.
<SimpleLineSymbol> outline Required See SimpleLineSymbol.
<dojo.Color> color Required 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")
Code snippets:
var sfs = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
 new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT,
 new dojo.Color([255,0,0]), 2),new dojo.Color([255,255,0,0.25]));
Properties Detail

<String> style

The fill style. See the Constants table for valid values. The default value is STYLE_SOLID. Color is valid only with STYLE_SOLID.
Default value: STYLE_SOLID
Methods Detail

setStyle(style)

Sets the fill symbol style.
Return value: SimpleFillSymbol
Input Parameters:
<String> style Required Fill style. See the Constants table for valid values.