require(["esri/symbols/SimpleLineSymbol"], function(SimpleLineSymbol) { /* code goes here */ });Description
(Added at v1.0)
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.
Explore the SimpleLineSymbol 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.
SamplesSearch for
samplesthat use this class.
Class hierarchyesri/symbols/Symbol |_esri/symbols/LineSymbol |_esri/symbols/SimpleLineSymbolSubclasses Constructors 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_LONGDASH
Line is constructed of a series of dashes. STYLE_LONGDASHDOT
Line is constructed of a series of short dashes. STYLE_NULL
The line has no symbol. STYLE_SHORTDASH
Line is constructed of a series of short dashes. STYLE_SHORTDASHDOT
Line is constructed of a dash followed by a dot. STYLE_SHORTDASHDOTDOT
Line is constructed of a series of a dash and two dots. STYLE_SHORTDOT
Line is constructed of a series of short dots. STYLE_SOLID
The line is solid. Properties Methods
Constructor Details
Creates a new empty SimpleLineSymbol object.
Sample:require([ "esri/symbols/SimpleLineSymbol", ... ], function(SimpleLineSymbol, ... ) { var sls = new SimpleLineSymbol(); ... });
Creates a new SimpleLineSymbol object with parameters.
Parameters: <String
> style Required See Constants table for values. <Color
> color Required Symbol color. <Number
> width Required Width of the line in pixels. Sample:
require([ "esri/symbols/SimpleLineSymbol", "esri/Color", ... ], function(SimpleLineSymbol, Color, ... ) { var sls = new SimpleLineSymbol( SimpleLineSymbol.STYLE_DASH, new Color([255,0,0]), 3 ); ... });
Creates a new SimpleLineSymbol object using a JSON object.
Parameters: <Object
> json Required JSON object representing the SimpleLineSymbol. 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
Indicates marker symbols present at the beginning and/or end of a SimpleLineSymbol. See the object specification table in the
setMarker()method for details of the properties of this object.
(Added at v3.23)The line style. See the Constants table for valid values.
Default value: STYLE_SOLID
The type of symbol.
Known values: simplemarkersymbol | picturemarkersymbol | simplelinesymbol | cartographiclinesymbol | simplefillsymbol | picturefillsymbol | textsymbol
Width of line symbol in pixels.
Default value: 1
Method Details
Sets the symbol color.
Parameters: <Color
> color Required Symbol color. Sample:
require([ "esri/Color", ... ], function(Color, ... ) { symbol.setColor(new Color([255,255,0,0.5])); ... });
Sets marker symbols at the beginning and/or end of a SimpleLineSymbol. (Added at v3.23)
Parameters: <Object
> options Required The options defining the marker style and placement. See the object specification table below. Object Specifications:
<options
>
String
> placement Required Indicates where the marker is placed on the line symbol. Valid values are begin
, end
, and begin-end
. <String
> style Required Indicates the style of the marker to place on the line symbol. As of version 3.23, the only supported style is arrow
. Sample:
lineSymbol.setMarker({
style: "arrow",
placement: "end"
});
Sets the line symbol style.
Parameters: <String
> style Required Line style. See the Constants table for valid values.
Sets the LineSymbol width.
Parameters: <Number
> width Required Width of line symbol in pixels. Sample:
require([ "esri/symbols/SimpleLineSymbol", ... ], function(SimpleLineSymbol, ... ) { var outline = new SimpleLineSymbol().setWidth(1); ... });
Converts object to its ArcGIS Server JSON representation.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4