- All Implemented Interfaces:
JsonSerializable
Simple marker symbols display graphics and features (collectively referred to as geoelements) using
predefined markers such as circle and cross. These symbols can have an optional outline, which is defined as a
SimpleLineSymbol.
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));OR
GraphicsOverlay.setRenderer(new SimpleRenderer(SimpleMarkerSymbol));
- Since:
- 100.0.0
- See Also:
-
Property Summary
Properties -
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the marker style for this SimpleMarkerSymbol.Nested classes/interfaces inherited from class com.esri.arcgisruntime.symbology.MarkerSymbol
MarkerSymbol.AngleAlignment -
Constructor Summary
ConstructorsConstructorDescriptionCreates a simple marker symbol object.SimpleMarkerSymbol(SimpleMarkerSymbol.Style style, int color, float size) Deprecated, for removal: This API element is subject to removal in a future version.SimpleMarkerSymbol(SimpleMarkerSymbol.Style style, Color color, float size) Creates a simple marker symbol with the given properties. -
Method Summary
Modifier and TypeMethodDescriptionThe interior color of this Symbol.getColor()Gets the value of thecolorproperty.Gets the SimpleLineSymbol used to create the border of this Symbol, if any border is present.floatgetSize()Gets the size of the simple marker symbol in device independent pixels (DIPs).getStyle()Gets the style of the simple marker symbol, such as circle, cross, or diamond.voidsetColor(int color) Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bysetColor(Color)voidSets the value of thecolorproperty.voidsetOutline(SimpleLineSymbol outline) Sets the SimpleLineSymbol used to create the border of the Symbol.voidsetSize(float size) Sets the size of the simple marker symbol in device independent pixels (DIPs).voidsetStyle(SimpleMarkerSymbol.Style style) Sets the style of the simple marker symbol, such as circle, cross, or diamond.Converts a SimpleMarkerSymbol to aMultilayerPointSymbol.Methods inherited from class com.esri.arcgisruntime.symbology.MarkerSymbol
getAngle, getAngleAlignment, getLeaderOffsetX, getLeaderOffsetY, getOffsetX, getOffsetY, setAngle, setAngleAlignment, setLeaderOffsetX, setLeaderOffsetY, setOffsetX, setOffsetYMethods inherited from class com.esri.arcgisruntime.symbology.Symbol
createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, fromJson, getUnknownJson, getUnsupportedJson, toJson
-
Property Details
-
color
The interior color of this Symbol.Default value is Color.LIGHTGRAY.
Attempting to set the color to null will throw a NullPointerException exception.
- Since:
- 200.0.0
- See Also:
-
-
Constructor Details
-
SimpleMarkerSymbol
public SimpleMarkerSymbol()Creates a simple marker symbol object.The default values are:
-
getStyle()-SimpleMarkerSymbol.Style.CIRCLE -
getSize()- 8.0 -
colorProperty()- gray
This is useful if the properties of the symbol are only known after the application is running.
- Since:
- 100.0.0
-
-
SimpleMarkerSymbol
@Deprecated(since="200.0.0", forRemoval=true) public SimpleMarkerSymbol(SimpleMarkerSymbol.Style style, int color, float size) Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bySimpleMarkerSymbol(Style, Color, float)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:
IllegalArgumentException- if style is nullIllegalArgumentException- if size is less than 0- Since:
- 100.0.0
-
SimpleMarkerSymbol
Creates a simple marker symbol with the given properties.- Parameters:
style- the marker style for this Symbol, not nullcolor- the interior colorsize- the size of the simple marker symbol in device independent pixels (DIPs)- Throws:
IllegalArgumentException- if style is nullIllegalArgumentException- if color is nullIllegalArgumentException- if size is less than 0- Since:
- 200.0.0
-
-
Method Details
-
toMultilayerSymbol
Converts a SimpleMarkerSymbol to aMultilayerPointSymbol.This method allows you to create complex and custom symbols with multiple layers of different type of symbology. Simple marker symbol provides a factory of shapes such as square, diamond, and cross. This method generates a
MultilayerPointSymbolthat contains aVectorMarkerSymbolLayerthat has aVectorMarkerSymbolElementwith a polygon representation of the simple marker symbol geometry.- Returns:
- a converted multilayer point symbol
- Since:
- 100.5.0
-
getStyle
Gets the style of the simple marker symbol, such as circle, cross, or diamond.Default value is CIRCLE.
- Returns:
- the marker style for this Symbol
- Since:
- 100.0.0
- See Also:
-
setStyle
Sets the style of the simple marker symbol, such as circle, cross, or diamond.- Parameters:
style- the new marker style for this Symbol, not null- Throws:
IllegalArgumentException- if style is null- Since:
- 100.0.0
- See Also:
-
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:
-
setOutline
Sets the SimpleLineSymbol used to create the border of the Symbol.- Parameters:
outline- the new outline, not null- Throws:
IllegalArgumentException- if outline is null- Since:
- 100.0.0
- See Also:
-
getSize
public float getSize()Gets the size of the simple marker symbol in device independent pixels (DIPs).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 size of the simple marker symbol in device independent pixels (DIPs).- Parameters:
size- the new size in dp of the symbol- Since:
- 100.0.0
-
colorProperty
The interior color of this Symbol.Default value is Color.LIGHTGRAY.
Attempting to set the color to null will throw a NullPointerException exception.
- Returns:
- the
colorproperty - Since:
- 200.0.0
- See Also:
-
getColor
Gets the value of thecolorproperty.- Property description:
- The interior color of this Symbol.
Default value is Color.LIGHTGRAY.
Attempting to set the color to null will throw a NullPointerException exception.
- Returns:
- the value of the
colorproperty - Since:
- 200.0.0
- See Also:
-
setColor
Sets the value of thecolorproperty.- Property description:
- The interior color of this Symbol.
Default value is Color.LIGHTGRAY.
Attempting to set the color to null will throw a NullPointerException exception.
- Parameters:
color- the value for thecolorproperty- Since:
- 200.0.0
- See Also:
-
setColor
Deprecated, for removal: This API element is subject to removal in a future version.as of 200.0.0, replaced bysetColor(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
-
SimpleMarkerSymbol(Style, Color, float)