Description
Line symbols are used to draw linear features on the graphics layer. CartographicLineSymbol, like
SimpleLineSymbol, is either a solid line or a predefined pattern of dashes and dots. Line joins and line caps can be added to further define the line symbol.
Samples
Search for
samples that use this class.
Class hierarchy
esri.symbol.Symbol
|_ esri.symbol.LineSymbol
|_ esri.symbol.SimpleLineSymbol
|_esri.symbol.CartographicLineSymbol
Constructor
Properties
| cap |
String
|
The cap style. See the Constants table for valid values. The default value is CAP_BUTT. |
| join |
String
|
The join style. See the Constants table for valid values. The default value is JOIN_MITER. |
| miterLimit |
String
|
Size threshold for showing mitered line joins. |
Constants
| CAP_BUTT |
Line ends square at the end point.
|
| CAP_ROUND |
Line is rounded just beyond the end point. |
| CAP_SQUARE |
Line is squared just beyond the end point. |
| JOIN_BEVEL |
The joined lines are beveled.
|
| JOIN_MITER |
The joined lines are not rounded or beveled. |
| JOIN_ROUND |
The joined lines are rounded. |
Methods
Constructor Detail
esri.symbol.CartographicLineSymbol()
Creates a new empty CartographicLineSymbol object.
Code snippets:
var cls = new esri.symbol.CartographicLineSymbol();
esri.symbol.CartographicLineSymbol(json)
Creates a new CartographicLineSymbol object using a JSON object.
Parameters:
|
<Object>
json |
Required |
JSON object representing the CartographicLineSymbol.
|
esri.symbol.CartographicLineSymbol(style?, color?, width?, cap?, join?, miterLimit?)
Creates a new CartographicLineSymbol object with parameters.
Parameters:
|
<String>
style |
Optional |
See Constants table for values.
|
|
<dojo.Color>
color |
Optional |
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 |
Optional |
Width of the line in pixels.
|
|
<String>
cap |
Optional |
See Constants table for values.
|
|
<String>
join |
Optional |
See Constants table for values.
|
|
<String>
miterLimit |
Optional |
Size threshold for showing mitered line joins.
|
Code snippets:
var cls = new esri.symbol.CartographicLineSymbol(esri.symbol.CartographicLineSymbol.STYLE_SOLID,
new dojo.Color([255,0,0]), 10, esri.symbol.CartographicLineSymbol.CAP_ROUND,
esri.symbol.CartographicLineSymbol.JOIN_MITER, 5);
Properties Detail
The cap style. See the Constants table for valid values. The default value is CAP_BUTT.
Default value: CAP_BUTT
The join style. See the Constants table for valid values. The default value is JOIN_MITER.
Default value: JOIN_MITRE
Size threshold for showing mitered line joins.
Default value: 10
Methods Detail
Sets the cap style.
Input Parameters:
|
<String> cap |
Required |
Cap style. See the Constants table for valid values. |
Sets the join style.
Input Parameters:
|
<String> join |
Required |
Join style. See the Constants table for valid values. |
setMiterLimit(miterLimit)
Sets the size threshold for showing mitered line joins.
Input Parameters:
|
<String> miterLimit |
Required |
Miter limit. |