- All Implemented Interfaces:
JsonSerializable
This may be different for each feature (driven by one or more feature attributes) or constant for all features (specified by a fixed number).
These properties will only be used if the getAngleExpression()
has an Arcade expression set into its
ArcadeExpression.getExpression()
property.
- Since:
- 100.11.0
-
Constructor Summary
ConstructorDescriptionLabelAngle
(ArcadeExpression arcadeExpression) Creates aLabelAngle
with the specifiedArcadeExpression
.LabelAngle
(ArcadeExpression arcadeExpression, LabelAngleRotationType rotationType) -
Method Summary
Modifier and TypeMethodDescriptionstatic LabelAngle
Creates a LabelAngle instance from a JSON string.Gets how the angle (in degrees) is calculated from the feature attributes, using an Arcade expression.Gets whether the angle should be interpreted as arithmetic or geographic.Gets unknown data from the source JSON.Gets unsupported data from the source JSON.void
setAngleExpression
(ArcadeExpression angleExpression) Sets how the angle (in degrees) is calculated from the feature attributes, using an Arcade expression.void
setRotationType
(LabelAngleRotationType rotationType) Sets whether the angle should be interpreted as arithmetic or geographic.toJson()
Serializes this object to a JSON string.
-
Constructor Details
-
LabelAngle
Creates aLabelAngle
with the specifiedArcadeExpression
.The
getRotationType()
will be defaulted toLabelAngleRotationType.AUTOMATIC
.- Parameters:
arcadeExpression
- The Arcade expression script. The expression is expected to be a complete, self-contained Arcade expression that calculates an angle in degrees.- Throws:
IllegalArgumentException
- if arcadeExpression is null- Since:
- 100.11.0
-
LabelAngle
Creates aLabelAngle
with the specifiedArcadeExpression
andLabelAngleRotationType
. The expression is expected to be a complete, self-contained Arcade expression that calculates an angle in degrees.- Parameters:
arcadeExpression
- The Arcade expression script. The expression is expected to be a complete, self-contained Arcade expression that calculates an angle in degrees.rotationType
- specifies whether the angle should be interpreted as arithmetic or geographic- Throws:
IllegalArgumentException
- if arcadeExpression is nullIllegalArgumentException
- if rotationType is null- Since:
- 100.11.0
-
-
Method Details
-
getAngleExpression
Gets how the angle (in degrees) is calculated from the feature attributes, using an Arcade expression.The calculation may use attributes, fixed numbers, or a combination of both. The default value is an ArcadeExpression containing an empty expression string, which will produce a zero angle when evaluated.
- Returns:
- the Arcade expression
- Since:
- 100.11.0
-
setAngleExpression
Sets how the angle (in degrees) is calculated from the feature attributes, using an Arcade expression.The calculation may use attributes, fixed numbers, or a combination of both.
Warning: If the expression attempts to use attributes which don't exist then no label will be produced. This is distinct from the attribute existing but having a null or empty value, which will be interpreted as a zero angle.
- Parameters:
angleExpression
- The Arcade expression to use. If the expression within it is an empty string, then the LabelAngle will not modify the position or layout of the label.- Throws:
IllegalArgumentException
- if angleExpression is null- Since:
- 100.11.0
-
getRotationType
Gets whether the angle should be interpreted as arithmetic or geographic.The default value is
LabelAngleRotationType.AUTOMATIC
(which will be interpreted asLabelAngleRotationType.ARITHMETIC
).- Returns:
- whether the angle should be interpreted as arithmetic or geographic
- Since:
- 100.11.0
-
setRotationType
Sets whether the angle should be interpreted as arithmetic or geographic.- Parameters:
rotationType
- whether the angle should be interpreted as arithmetic or geographic- Throws:
IllegalArgumentException
- if rotationType is null- Since:
- 100.11.0
-
fromJson
Creates a LabelAngle instance from a JSON string.- Parameters:
json
- a JSON string that represents a LabelAngle- Returns:
- a LabelAngle instance
- Throws:
IllegalArgumentException
- if json is null or empty- Since:
- 100.11.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
-