dojo.require("esri.symbols.SimpleFillSymbol")
Description
(Added at v1.0)
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.
Explore the SimpleFillSymbol in the
ArcGIS Symbol Playground. This is a place to explore and learn how to work with various properties and methods before implementing it into custom code. Try out new features, customize them, and copy the generated code into your own application. This sample provides a starting point so as to allow use of these features as quickly as possible.
Samples
Search for
samples that use this class.
Class hierarchy
esri.symbol.Symbol
|_esri.symbol.FillSymbol
|_esri.symbol.SimpleFillSymbol
Constructors
Constants
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. |
Properties
Methods
Constructor Details
Creates a new empty SimpleFillSymbol object.
Sample:
var sfs = new esri.symbol.SimpleFillSymbol();
Creates a new SimpleFillSymbol object with parameters.
Sample:
var sfs = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT,
new esri.Color([255,0,0]), 2),new esri.Color([255,255,0,0.25]));
Creates a new SimpleFillSymbol object using a JSON object.
Parameters:
<Object > json |
Required |
JSON object representing the SimpleFillSymbol. View the Symbol Objects (Common data types in ArcGIS) for details
on creating a JSON symbol. Note that when specifying symbol width and height using JSON the values should be entered in points, the JavaScript API then converts the point values to pixels. |
Property Details
Symbol color - only applies when SimpleFillSymbol.style = 'STYLE_SOLID'
.
The fill style. See the Constants table for valid values. Color is valid only with STYLE_SOLID.
Default value: STYLE_SOLID
The type of symbol.
Known values: simplemarkersymbol | picturemarkersymbol | simplelinesymbol | cartographiclinesymbol | simplefillsymbol | picturefillsymbol | textsymbol
Method Details
Sets the symbol color - only applies when style is STYLE_SOLID.
Parameters:
<Color > color |
Required |
Symbol color. |
Sets the outline of the fill symbol.
Sample:
selSymbol.setOutline(new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new esri.Color([255,0,0]), 2));
Sets the fill symbol style.
Parameters:
<String > style |
Required |
Fill style. See the Constants table for valid values. |
Converts object to its ArcGIS Server JSON representation.