Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: LineSymbol

require(["esri/symbols/LineSymbol"], function(LineSymbol) { /* code goes here */ });

Description

(Added at v1.0)
Line symbols are used to draw linear features on the graphics layer.

LineSymbol has no constructor. Use SimpleLineSymbol or CartographicLineSymbol.

Samples

Search for samples that use this class.

Class hierarchy

esri/symbols/Symbol
|_esri/symbols/LineSymbol

Subclasses

Properties

NameTypeSummary
colorColorSymbol color.
typeStringThe type of symbol.
widthNumberWidth of line symbol in pixels.

Methods

NameReturn typeSummary
setColor(color)SymbolSets the symbol color.
setWidth(width)LineSymbolSets the LineSymbol width.
toJson()ObjectConverts object to its ArcGIS Server JSON representation.
Property Details

<Color> color

Symbol color.

<String> type

The type of symbol.
Known values: simplemarkersymbol | picturemarkersymbol | simplelinesymbol | cartographiclinesymbol | simplefillsymbol | picturefillsymbol | textsymbol

<Number> width

Width of line symbol in pixels.
Default value: 1
Method Details

setColor(color)

Sets the symbol color.
Return type: Symbol
Parameters:
<Color> color Required Symbol color.
Sample:
require([
  "esri/Color", ... 
], function(Color, ... ) {
  symbol.setColor(new Color([255,255,0,0.5]));
  ...
});

setWidth(width)

Sets the LineSymbol width.
Return type: LineSymbol
Parameters:
<Number> width Required Width of line symbol in pixels.
Sample:
require([
  "esri/symbols/SimpleLineSymbol", ... 
], function(SimpleLineSymbol, ... ) {
  var outline = new SimpleLineSymbol().setWidth(1);
  ...
});

toJson()

Converts object to its ArcGIS Server JSON representation.
Return type: Object