Package com.esri.arcgisruntime.symbology
Class SimpleMarkerSymbol
- java.lang.Object
 - 
- com.esri.arcgisruntime.symbology.Symbol
 - 
- com.esri.arcgisruntime.symbology.MarkerSymbol
 - 
- com.esri.arcgisruntime.symbology.SimpleMarkerSymbol
 
 
 
 
- 
- All Implemented Interfaces:
 JsonSerializable
public final class SimpleMarkerSymbol extends MarkerSymbol
Defines a SimpleMarkerSymbol which is a MarkerSymbol based on simple shapes.SimpleMarkerSymbols symbolize Graphics and Features that have a Point or Multipoint geometry using simple predefined markers such as a circle. A LineSymbol can be used in combination with a SimpleMarkerSymbol to add an outline. The outline of the SimpleMarkerSymbol can be set once it has been created, but this property is optional.
Example of creating a SimpleMarkerSymbol:
// create points for the line Point point = new Point(-1.1579397849033352E7, 5618494.623878779); // creates a red circle simple marker symbol SimpleMarkerSymbol markerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.CIRCLE, 0xffff0000, 10); // add the point with a symbol to graphics overlay and add overlay to map view GraphicsOverlay graphicsOverlay = new GraphicsOverlay(); mapView.getGraphicsOverlays().add(graphicsOverlay); graphicsOverlay.getGraphics().add(new Graphic(point, markerSymbol));
A SimpleMarkerSymbol can be displayed using a Graphic and setting it to a GraphicsOverlay or setting the symbol as a Renderer.
GraphicsOverlay.getGraphics().add(new Graphic(Geometry, SimpleMarkerSymbol));
ORGraphicsOverlay.setRenderer(new SimpleRenderer(SimpleMarkerSymbol));
- Since:
 - 100.0.0
 - See Also:
 Graphic,GraphicsOverlay,SimpleRenderer,SimpleLineSymbol
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleMarkerSymbol.StyleDefines the marker style for this SimpleMarkerSymbol.- 
Nested classes/interfaces inherited from class com.esri.arcgisruntime.symbology.MarkerSymbol
MarkerSymbol.AngleAlignment 
 - 
 
- 
Constructor Summary
Constructors Constructor Description SimpleMarkerSymbol()Creates a new SimpleMarkerSymbol with default properties set.SimpleMarkerSymbol(SimpleMarkerSymbol.Style style, int color, float size)Creates a new SimpleMarkerSymbol with the given properties: Color, interior color of the Symbol. Size, height and width of the area to place the Symbol in. Style, the shape that makes up the the Symbol. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetColor()Gets the interior color of this Symbol as a ARGB(alpha, red, green, blue) value.SimpleLineSymbolgetOutline()Gets the SimpleLineSymbol used to create the border of this Symbol, if any border is present.floatgetSize()Gets the height and width in density-independent pixels (dp) of the symbol.SimpleMarkerSymbol.StylegetStyle()Gets the marker style that describes what shape this Symbol is displayed as.voidsetColor(int color)Sets the interior color of this Symbol to a ARGB(alpha, red, green, blue) value.voidsetOutline(SimpleLineSymbol outline)Sets the SimpleLineSymbol used to create the border of the Symbol.voidsetSize(float size)Sets the height and width in density-independent pixels (dp) of the symbol.voidsetStyle(SimpleMarkerSymbol.Style style)Sets the marker style that describes what shape this Symbol is going to be displayed as.MultilayerPointSymboltoMultilayerSymbol()Gets a multilayer point symbol generated from this simple marker symbol.- 
Methods inherited from class com.esri.arcgisruntime.symbology.MarkerSymbol
getAngle, getAngleAlignment, getLeaderOffsetX, getLeaderOffsetY, getOffsetX, getOffsetY, getRotationType, setAngle, setAngleAlignment, setLeaderOffsetX, setLeaderOffsetY, setOffsetX, setOffsetY, setRotationType 
- 
Methods inherited from class com.esri.arcgisruntime.symbology.Symbol
createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, fromJson, getUnknownJson, getUnsupportedJson, toJson 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
SimpleMarkerSymbol
public SimpleMarkerSymbol()
Creates a new SimpleMarkerSymbol with default properties set. Useful if the properties of the symbol are only known after the application is running.Default properties:
- Color, gray, 0xFFD3D3D3
 - Size, 8.0
 - Style, Circle
 
- Since:
 - 100.0.0
 
 
- 
SimpleMarkerSymbol
public SimpleMarkerSymbol(SimpleMarkerSymbol.Style style, int color, float size)
Creates a new SimpleMarkerSymbol with the given properties:- Color, interior color of the Symbol.
 - Size, height and width of the area to place the Symbol in.
 - Style, the shape that makes up the the Symbol.
 
- Parameters:
 style- the marker style for this Symbol, not nullcolor- an integer representing the interior color as 0xAARRGGBBsize- the size of this Symbol, must be 0 or greater- Throws:
 java.lang.IllegalArgumentException- if style is nulljava.lang.IllegalArgumentException- if size is less than 0- Since:
 - 100.0.0
 
 
 - 
 
- 
Method Detail
- 
toMultilayerSymbol
public MultilayerPointSymbol toMultilayerSymbol()
Gets a multilayer point symbol generated from this simple marker symbol. The multilayer symbol will consist of aVectorMarkerSymbolLayerwhich will containVectorMarkerSymbolElementsthat represent the converted marker symbol.- Returns:
 - a converted multilayer point symbol
 - Since:
 - 100.5.0
 
 
- 
getStyle
public SimpleMarkerSymbol.Style getStyle()
Gets the marker style that describes what shape this Symbol is displayed as.Default value is CIRCLE.
- Returns:
 - the marker style for this Symbol
 - Since:
 - 100.0.0
 - See Also:
 SimpleMarkerSymbol.Style
 
- 
setStyle
public void setStyle(SimpleMarkerSymbol.Style style)
Sets the marker style that describes what shape this Symbol is going to be displayed as.- Parameters:
 style- the new marker style for this Symbol, not null- Throws:
 java.lang.IllegalArgumentException- if style is null- Since:
 - 100.0.0
 - See Also:
 SimpleMarkerSymbol.Style
 
- 
getOutline
public SimpleLineSymbol getOutline()
Gets the SimpleLineSymbol used to create the border of this Symbol, if any border is present.Default value is null.
- Returns:
 - the outline if there is one or null otherwise
 - Since:
 - 100.0.0
 - See Also:
 SimpleLineSymbol
 
- 
setOutline
public void setOutline(SimpleLineSymbol outline)
Sets the SimpleLineSymbol used to create the border of the Symbol.- Parameters:
 outline- the new outline, not null- Throws:
 java.lang.IllegalArgumentException- if outline is null- Since:
 - 100.0.0
 - See Also:
 SimpleLineSymbol
 
- 
getSize
public float getSize()
Gets the height and width in density-independent pixels (dp) of the symbol.Default value is 8.0.
- Returns:
 - the size in dp of this symbol
 - Since:
 - 100.0.0
 
 
- 
setSize
public void setSize(float size)
Sets the height and width in density-independent pixels (dp) of the symbol.- Parameters:
 size- the new size in dp of the symbol- Since:
 - 100.0.0
 
 
- 
getColor
public int getColor()
Gets the interior color of this Symbol as a ARGB(alpha, red, green, blue) value.Default value is gray, 0xFFD3D3D3.
- Returns:
 - an integer representing the interior color as 0xAARRGGBB
 - Since:
 - 100.0.0
 
 
- 
setColor
public void setColor(int color)
Sets the interior color of this Symbol to a ARGB(alpha, red, green, blue) value.- Parameters:
 color- an integer representing the interior color as 0xAARRGGBB- Since:
 - 100.0.0
 
 
 - 
 
 -