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

Description

Marker symbols are used to draw points and multipoints on the graphics layer. SimpleMarkerSymbol is used to display points as a simple shape, for example, a circle. In addition, the symbol can have an optional outline, which is defined by a line symbol.

Class hierarchy

esri.symbol.Symbol
  |_ esri.symbol.MarkerSymbol
        |_ esri.symbol.SimpleMarkerSymbol

Constructor

Constructor Description
esri.symbol.SimpleMarkerSymbol(json) Creates a new SimpleMarkerSymbol object using a JSON object.
esri.symbol.SimpleMarkerSymbol() Creates a new empty SimpleMarkerSymbol object.
esri.symbol.SimpleMarkerSymbol(style, size, outline, color) Creates a new SimpleMarkerSymbol object with parameters.

Properties

Property Type Description
outline SimpleLineSymbol Outline of the marker.
style String The marker style. See the Constants table for valid values. The default value is STYLE_CIRCLE.

Constants

Constant Description
STYLE_CIRCLE The marker is a circle.
STYLE_CROSS The marker is a cross.
STYLE_DIAMOND The marker is a diamond.
STYLE_SQUARE The marker is a square.
STYLE_X The marker is a diagonal cross.

Methods

Method Return Value Description
setOutline(outline) SimpleMarkerSymbol Sets the outline of the marker symbol.
setStyle(style) SimpleMarkerSymbol Sets the marker symbol style.
Constructor Detail

esri.symbol.SimpleMarkerSymbol(json)

Creates a new SimpleMarkerSymbol object using a JSON object.
Parameters:
<Object> json Required JSON object representing the SimpleMarkerSymbol.

esri.symbol.SimpleMarkerSymbol()

Creates a new empty SimpleMarkerSymbol object.
Code snippets:
new esri.symbol.SimpleMarkerSymbol();

esri.symbol.SimpleMarkerSymbol(style, size, outline, color)

Creates a new SimpleMarkerSymbol object with parameters.
Parameters:
<String> style Required See Constants table for values.
<Number> size Required Size of the marker in pixels.
<SimpleLineSymbol> outline Required See SimpleLineSymbol.
<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")
Code snippets:
 
 new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_SQUARE, 10,
   new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, 
   new dojo.Color([255,0,0]), 1),
   new dojo.Color([0,255,0,0.25]));
Properties Detail

<SimpleLineSymbol> outline

Outline of the marker.

<String> style

The marker style. See the Constants table for valid values. The default value is STYLE_CIRCLE.
Default value: STYLE_CIRCLE
Methods Detail

setOutline(outline)

Sets the outline of the marker symbol.
Return value: SimpleMarkerSymbol
Input Parameters:
<SimpleLineSymbol> outline Required Symbol used for outline.

setStyle(style)

Sets the marker symbol style.
Return value: SimpleMarkerSymbol
Input Parameters:
<String> style Required Marker style. See the Constants table for valid values.