Description
Line symbols are used to draw linear features on the graphics layer. SimpleLineSymbol is either a solid line or a predefined pattern of dashes and dots.
Class hierarchy
esri.symbol.Symbol
|_ esri.symbol.LineSymbol
|_ esri.symbol.SimpleLineSymbol
Subclasses
CartographicLineSymbol Constructor
Properties
| style |
String
|
The line style. See the Constants table for valid values. The default value is STYLE_SOLID. |
Constants
| STYLE_DASH |
The line is made of dashes. |
| STYLE_DASHDOT |
The line is made of a dash-dot pattern. |
| STYLE_DASHDOTDOT |
The line is made of a dash-dot-dot pattern. |
| STYLE_DOT |
The line is made of dots. |
| STYLE_NULL |
The line has no symbol. |
| STYLE_SOLID |
The line is solid. |
Methods
Constructor Detail
esri.symbol.SimpleLineSymbol()
Creates a new empty SimpleLineSymbol object.
Code snippets:
new esri.symbol.SimpleLineSymbol();
esri.symbol.SimpleLineSymbol(style, color, width)
Creates a new SimpleLineSymbol object with parameters.
Parameters:
|
<String>
style |
Required |
See Constants table for values.
|
|
<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")
|
|
<Number>
width |
Required |
Width of the line in pixels.
|
Code snippets:
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASH, new dojo.Color([255,0,0]), 3);
esri.symbol.SimpleLineSymbol(json)
Creates a new SimpleLineSymbol object using a JSON object.
Parameters:
|
<Object>
json |
Required |
JSON object representing the SimpleLineSymbol.
|
Properties Detail
The line style. See the Constants table for valid values. The default value is STYLE_SOLID.
Default value: STYLE_SOLID
Methods Detail
Sets the line symbol style.
Input Parameters:
|
<String> style |
Required |
Line style. See the Constants table for valid values. |