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

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.

Class hierarchy

esri.symbol.Symbol
  |_ esri.symbol.LineSymbol
        |_ esri.symbol.SimpleLineSymbol
		      |_esri.symbol.CartographicLineSymbol

Constructor

Constructor Description
esri.symbol.CartographicLineSymbol() Creates a new empty CartographicLineSymbol object.
esri.symbol.CartographicLineSymbol(json) Creates a new CartographicLineSymbol object using a JSON object.
esri.symbol.CartographicLineSymbol(style?, color?, width?, cap?, join?, miterLimit?) Creates a new CartographicLineSymbol object with parameters.

Properties

Property Type Description
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

Constant Description
CAP_BUTT Line ends square at the end point.

line cap types
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.

line join types
JOIN_MITER The joined lines are not rounded or beveled.
JOIN_ROUND The joined lines are rounded.

Methods

Method Return Value Description
setCap(cap) CartographicLineSymbol Sets the cap style.
setJoin(join) CartographicLineSymbol Sets the join style.
setMiterLimit(miterLimit) CartographicLineSymbol Sets the size threshold for showing mitered line joins.
Constructor Detail

esri.symbol.CartographicLineSymbol()

Creates a new empty CartographicLineSymbol object.
Code snippets:
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

<String> cap

The cap style. See the Constants table for valid values. The default value is CAP_BUTT.
Default value: CAP_BUTT

<String> join

The join style. See the Constants table for valid values. The default value is JOIN_MITER.
Default value: JOIN_MITRE

<String> miterLimit

Size threshold for showing mitered line joins.
Default value: 10
Methods Detail

setCap(cap)

Sets the cap style.
Input Parameters:
<String> cap Required Cap style. See the Constants table for valid values.

setJoin(join)

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.