- All Implemented Interfaces:
JsonSerializable
- Direct Known Subclasses:
ClassBreaksRenderer
,DictionaryRenderer
,HeatmapRenderer
,SimpleRenderer
,UniqueValueRenderer
,UnsupportedRenderer
Layer
or
graphics in a GraphicsOverlay
.
If the renderer contains more than a single symbol, it uses the rules to determine the symbol to apply to each geoelement, based on one or several attribute values. There are three basic types of renderers:
-
SimpleRenderer
- simple renderers use a single symbol for all geoelements. -
UniqueValueRenderer
- unique value renders define a different symbol for each unique value of an attribute. -
ClassBreaksRenderer
- class break renderers define a different symbol for each range of numeric values.
To symbolize and display the geoelements, set the renderer with FeatureLayer.setRenderer(Renderer)
or GraphicsOverlay.setRenderer(Renderer)
.
A GraphicsOverlay
can contain graphics with different geometry dimensions, such as a Point
and
Polygon
. A Renderer, however, can only provide symbols with one geometry dimension. Therefore, if you
apply a renderer to a graphics overlay, only graphics with the specified geometry dimension are displayed. All
other graphics are not visible.
If you apply a Symbol
directly to a graphic, the symbol displays in preference to the GraphicsOverlay.rendererProperty()
.
For raster data, rendering is handled by a RasterRenderer
.
- Since:
- 100.0.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
This represents renderer properties applicable only to an ArcGISScene. -
Method Summary
Modifier and TypeMethodDescriptionstatic Renderer
Creates a Renderer instance from a JSON string.Gets the expression describing how attributes values are translated into a rotation to be applied to theGeoElement
.Gets whether the rotation calculated from thegetRotationExpression()
is interpreted as arithmetic or geographic.Gets the scene view properties for the renderer.abstract Symbol
Returns the symbol that is used to visualize the given feature.Returns the symbol that is used to visualize the given feature with override expressions from renderer.abstract Symbol
Returns the symbol that is used to visualize the given graphic.Returns the symbol that is used to visualize the given graphic with override expressions from renderer.getSymbol
(DynamicEntity dynamicEntity) Returns the symbol that is used to visualize the given dynamic entity.getSymbol
(DynamicEntityObservation dynamicEntityObservation) Returns the symbol that is used to visualize the given dynamic entity observation.getSymbol
(DynamicEntityObservation dynamicEntityObservation, boolean applyAttributeOverrides) Returns the symbol that is used to visualize the given dynamic entity observation with override attributes from the renderer.getSymbol
(DynamicEntity dynamicEntity, boolean applyAttributeOverrides) Returns the symbol that is used to visualize the given dynamic entity with override attributes from the renderer.Gets unknown data from the source JSON.Gets unsupported data from the source JSON.void
setRotationExpression
(String rotationExpression) Sets the expression describing how attributes values are translated into a rotation to be applied to theGeoElement
.void
setRotationType
(RotationType rotationType) Sets whether the rotation calculated from thegetRotationExpression()
is interpreted as arithmetic or geographic.toJson()
Serializes this object to a JSON string.
-
Method Details
-
fromJson
Creates a Renderer instance from a JSON string.- Parameters:
json
- a JSON string that represents a Renderer- Returns:
- a Renderer instance
- Throws:
IllegalArgumentException
- if json is null or empty- Since:
- 100.0.0
-
toJson
Description copied from interface:JsonSerializable
Serializes this object to a JSON string. Note that unknown JSON is omitted from the serialized string.- Specified by:
toJson
in interfaceJsonSerializable
- Returns:
- a JSON string
-
getUnknownJson
Description copied from interface:JsonSerializable
Gets unknown data from the source JSON.Unknown JSON is a Map of values not defined in the ArcGIS specification used to create this object but found in the source JSON. If the object is written back to JSON, any unknown JSON data is not persisted. The ArcGIS specification may be for a web map, web scene, REST API, and so on.
- Specified by:
getUnknownJson
in interfaceJsonSerializable
- Returns:
- an unmodifiable Map containing unknown data from the source JSON
-
getUnsupportedJson
Description copied from interface:JsonSerializable
Gets unsupported data from the source JSON.Unsupported JSON is a Map of values defined in the ArcGIS specification used to create this object but not currently used in this API. If the object is written back to JSON, any unsupported JSON data is persisted. The ArcGIS specification may be from a web map, web scene, REST API, and so on.
- Specified by:
getUnsupportedJson
in interfaceJsonSerializable
- Returns:
- an unmodifiable Map containing unsupported data from the source JSON
-
getSymbol
Returns the symbol that is used to visualize the given dynamic entity.If the renderer is a
DictionaryRenderer
and its associatedDictionarySymbolStyle
references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a validMultilayerSymbol
. If you want to get the symbol before the layer is rendered, useDictionarySymbolStyle.getSymbolAsync(Map)
.- Parameters:
dynamicEntity
- the dynamic entity- Returns:
- a
Symbol
, or null if none - Throws:
NullPointerException
- if dynamicEntity is null- Since:
- 200.1.0
-
getSymbol
Returns the symbol that is used to visualize the given dynamic entity with override attributes from the renderer.If applyAttributeOverrides is set to true, this method will get the symbol from the renderer and override the symbol properties with the overrides available on the renderer. These include visual variable size, color, opacity and rotation. If the override expression or attributes contain any information not known to either the renderer or dynamic entity (such as "scale"), that override will not be applied. If the override attributes are applied successfully, a symbol with overridden properties will be returned else the original symbol will be returned.
If the renderer is a
DictionaryRenderer
and its associatedDictionarySymbolStyle
references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a validMultilayerSymbol
. If you want to get the symbol before the layer is rendered, useDictionarySymbolStyle.getSymbolAsync(Map)
.- Parameters:
dynamicEntity
- the dynamic entityapplyAttributeOverrides
- if set to true, this applies the override attributes from the renderer to the symbol- Returns:
- a
Symbol
, or null if none - Throws:
NullPointerException
- if dynamicEntity is null- Since:
- 200.1.0
-
getSymbol
Returns the symbol that is used to visualize the given dynamic entity observation.If the renderer is a
DictionaryRenderer
and its associatedDictionarySymbolStyle
references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a validMultilayerSymbol
. If you want to get the symbol before the layer is rendered, useDictionarySymbolStyle.getSymbolAsync(Map)
.- Parameters:
dynamicEntityObservation
- the dynamic entity observation- Returns:
- a
Symbol
, or null if none - Throws:
NullPointerException
- if dynamicEntityObservation is null- Since:
- 200.1.0
-
getSymbol
public Symbol getSymbol(DynamicEntityObservation dynamicEntityObservation, boolean applyAttributeOverrides) Returns the symbol that is used to visualize the given dynamic entity observation with override attributes from the renderer.If applyAttributeOverrides is set to true, this method will get the symbol from the renderer and override the symbol properties with the overrides available on the renderer. These include visual variable size, color, opacity and rotation. If the override expression or attributes contain any information not known to either the renderer or observation (such as "scale"), that override will not be applied. If the override attributes are applied successfully, a symbol with overridden properties will be returned else the original symbol will be returned.
If the renderer is a
DictionaryRenderer
and its associatedDictionarySymbolStyle
references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a validMultilayerSymbol
. If you want to get the symbol before the layer is rendered, useDictionarySymbolStyle.getSymbolAsync(Map)
.- Parameters:
dynamicEntityObservation
- the dynamic entity observationapplyAttributeOverrides
- if set to true, this applies the override attributes from the renderer to the symbol- Returns:
- a
Symbol
, or null if none - Throws:
NullPointerException
- if dynamicEntityObservation is null- Since:
- 200.1.0
-
getSymbol
Returns the symbol that is used to visualize the given feature.If the renderer is a
DictionaryRenderer
and its associatedDictionarySymbolStyle
references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a validMultilayerSymbol
. If you want to get the symbol before the layer is rendered, useDictionarySymbolStyle.getSymbolAsync(Map)
.- Parameters:
feature
- the Feature to get a Symbol from, not null- Returns:
- the Symbol of the Feature that was passed
- Throws:
IllegalArgumentException
- if Feature is null- Since:
- 100.0.0
-
getSymbol
Returns the symbol that is used to visualize the given graphic.If the renderer is a
DictionaryRenderer
and its associatedDictionarySymbolStyle
references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a validMultilayerSymbol
. If you want to get the symbol before the layer is rendered, useDictionarySymbolStyle.getSymbolAsync(Map)
.- Parameters:
graphic
- the Graphic to get a Symbol from, not null- Returns:
- the Symbol of the Graphic that was passed
- Throws:
IllegalArgumentException
- if Graphic is null- Since:
- 100.0.0
-
getSymbol
Returns the symbol that is used to visualize the given feature with override expressions from renderer.If
applyAttributeOverrides
is set to true, this method will get the symbol from the renderer and override the symbol properties with the overrides available on the renderer. These include visual variable size, color, opacity and rotation. If the override expression or attributes contain any information not known to either the renderer or observation (such as "scale"), that override will not be applied. If the override attributes are applied successfully, a symbol with overridden properties will be returned otherwise the original symbol will be returned.If the renderer is a
DictionaryRenderer
and its associatedDictionarySymbolStyle
references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a validMultilayerSymbol
. If you want to get the symbol before the layer is rendered, useDictionarySymbolStyle.getSymbolAsync(Map)
.- Parameters:
feature
- the Feature to get a Symbol from, not nullapplyAttributeOverrides
- true to apply override attributes from renderer- Returns:
- the Symbol of the Feature that was passed
- Throws:
IllegalArgumentException
- if feature is null- Since:
- 100.5.0
-
getSymbol
Returns the symbol that is used to visualize the given graphic with override expressions from renderer.If
applyAttributeOverrides
is set to true, this method will get the symbol from the renderer and override the symbol properties with the overrides available on the renderer. These include visual variable size, color, opacity and rotation. If the override expression or attributes contain any information not known to either the renderer or observation (such as "scale"), that override will not be applied. If the override attributes are applied successfully, a symbol with overridden properties will be returned otherwise the original symbol will be returned.If the renderer is a
DictionaryRenderer
and its associatedDictionarySymbolStyle
references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a validMultilayerSymbol
. If you want to get the symbol before the layer is rendered, useDictionarySymbolStyle.getSymbolAsync(Map)
.- Parameters:
graphic
- the Graphic to get a Symbol from, not nullapplyAttributeOverrides
- true to apply override attributes from renderer- Returns:
- the Symbol of the Graphic that was passed
- Throws:
IllegalArgumentException
- if graphic is null- Since:
- 100.5.0
-
getRotationType
Gets whether the rotation calculated from thegetRotationExpression()
is interpreted as arithmetic or geographic.The options are:
-
RotationType.ARITHMETIC
- rotation is along the x-axis, with positive rotation being counter-clockwise. -
RotationType.GEOGRAPHIC
- rotation is along the y-axis, with positive rotation being clockwise.
RotationType.ARITHMETIC
if an error occurs.- Returns:
- the rotation type of this Symbol
- Since:
- 100.0.0
- See Also:
-
-
setRotationType
Sets whether the rotation calculated from thegetRotationExpression()
is interpreted as arithmetic or geographic.The options are:
-
RotationType.ARITHMETIC
- rotation is along the x-axis, with positive rotation being counter-clockwise. -
RotationType.GEOGRAPHIC
- rotation is along the y-axis, with positive rotation being clockwise.
- Parameters:
rotationType
- the new rotation type for this Symbol, not null- Throws:
IllegalArgumentException
- if input is null- Since:
- 100.0.0
-
-
getRotationExpression
Gets the expression describing how attributes values are translated into a rotation to be applied to theGeoElement
.When an attribute name is specified in the rotation expression, it is enclosed in square brackets, for example: [Rotation].
- Returns:
- the rotation expression
- Since:
- 100.0.0
- See Also:
-
setRotationExpression
Sets the expression describing how attributes values are translated into a rotation to be applied to theGeoElement
.When an attribute name is specified in the rotation expression, it is enclosed in square brackets, for example: [Rotation].
Example of setting a rotation expression with a SimpleRenderer:
GraphicsOverlay graphicsOverlay = new GraphicsOverlay(); mapView.getGraphicsOverlays().add(graphicsOverlay); Point randomPoint = new Point(2000000, 2000000); Graphic graphic = new Graphic(randomPoint); graphic.getAttributes().put("Rotation", 45); graphicsOverlay.getGraphics().add(graphic); SimpleMarkerSymbol symbol = new SimpleMarkerSymbol(Color.BLUE, 5, SimpleMarkerSymbol.Style.TRIANGLE); SimpleRenderer simpleRenderer = new SimpleRenderer(symbol); simpleRenderer.setRotationExpression("[Rotation]"); graphicsOverlay.setRenderer(simpleRenderer);
- Parameters:
rotationExpression
- the new rotation expression- Since:
- 100.0.0
- See Also:
-
getSceneProperties
Gets the scene view properties for the renderer.This can be used to make changes to how a
GeoElement
is displayed in aSceneView
.- Returns:
- the scene view properties for the renderer, which are applicable only to an ArcGISScene
- Since:
- 100.0.0
-