Class MarkerSymbol
- java.lang.Object
-
- com.esri.arcgisruntime.symbology.Symbol
-
- com.esri.arcgisruntime.symbology.MarkerSymbol
-
- All Implemented Interfaces:
JsonSerializable
- Direct Known Subclasses:
PictureMarkerSymbol
,SimpleMarkerSymbol
,TextSymbol
public abstract class MarkerSymbol extends Symbol
Defines a MarkerSymbol's basic functionality and is the base class for all MarkerSymbols, including TextSymbols.MarkerSymbols symbolize Graphics and Features that have a Point or Multipoint geometry and apply transformations to a Symbol. These transformations include rotating a Symbol, re-positioning a Symbol in relation to its starting point, and positioning a callout leader in relative to the Symbol's starting point.
There are two types of offsets that may be specified.
- The offset of the Symbol from the Symbol's geometry.
- The offset of a callout's leader line from the Symbol's geometry. A callout leader is an object that appears when a user hovers or clicks on a Symbol.
Offsets are specified in density-independent pixels (dp), using the Cartesian coordinate system. You can separately set the x and y components of both the symbol offset and the callout leader offset. For example, to offset the callout leader 5 dps to the left along the x-axis, pass a value of -5.0 to setLeaderOffsetX; to offset to the right instead, pass a value of 5.0.
Let's consider a PictureMarkerSymbol using an image of a pushpin. The center of the pushpin image will be placed where the Point is by default. However, if you wanted the needle of the pushpin to end at that Point, you would need to offset the image appropriately to make the needle's end coincide with that Point location.
Marker symbol rotation is controlled by angle and angle alignment.
- Since:
- 100.0.0
- See Also:
Geometry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MarkerSymbol.AngleAlignment
Defines whether the rotation of a Symbol is relative to the map or the user's screen.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description float
getAngle()
Gets the angle, in degrees, that the Symbol is rotated by.MarkerSymbol.AngleAlignment
getAngleAlignment()
Gets the AngleAlignment of the Symbol.float
getLeaderOffsetX()
Gets the callout's leader x-offset.float
getLeaderOffsetY()
Gets the callout's leader y-offset.float
getOffsetX()
Gets the offset of the Symbol's x coordinate from its starting location.float
getOffsetY()
Gets the offset of the Symbol's y coordinate from its starting location.RotationType
getRotationType()
Deprecated.As of 100.5.0.void
setAngle(float angle)
Sets the angle, in degrees, at which the Symbol will be rotated by.void
setAngleAlignment(MarkerSymbol.AngleAlignment angleAlignment)
Sets the AngleAlignment of the Symbol.void
setLeaderOffsetX(float offsetX)
Sets the callout's leader x-offset in density-independent pixels (dp).void
setLeaderOffsetY(float offsetY)
Sets the callout's leader y-offset in density-independent pixels (dp).void
setOffsetX(float offsetX)
Sets the offset of the Symbol's x coordinate from its starting location in density-independent pixels (dp).void
setOffsetY(float offsetY)
Sets the offset of the Symbol's y coordinate from its starting location in density-independent pixels (dp).void
setRotationType(RotationType rotationType)
Deprecated.As of 100.5.0.-
Methods inherited from class com.esri.arcgisruntime.symbology.Symbol
createSwatchAsync, createSwatchAsync, createSwatchAsync, createSwatchAsync, fromJson, getUnknownJson, getUnsupportedJson, toJson
-
-
-
-
Method Detail
-
getAngle
public float getAngle()
Gets the angle, in degrees, that the Symbol is rotated by.A full rotation is 360 units and default value is 0.0.
- Returns:
- the angle that the Symbol is rotated by
- Since:
- 100.0.0
- See Also:
setAngle(float)
-
setAngle
public void setAngle(float angle)
Sets the angle, in degrees, at which the Symbol will be rotated by.A rotation is anywhere from 0 to 360 units.
A positive number will rotate the Symbol clockwise while a negative number will cause the Symbol to rotate counter-clockwise.
AngleAlignment
will determine the Symbol's rotation in relation to the map.- Parameters:
angle
- the angle to rotate the Symbol- Since:
- 100.0.0
- See Also:
getAngleAlignment()
-
getAngleAlignment
public MarkerSymbol.AngleAlignment getAngleAlignment()
Gets the AngleAlignment of the Symbol.AngleAlignment specifies how the symbol will rotate, relative to the user's screen or the map.
If this has not been set, the default value is
SCREEN
.- Returns:
- the angle alignment of the symbol
- Since:
- 100.0.0
- See Also:
setAngleAlignment(com.esri.arcgisruntime.symbology.MarkerSymbol.AngleAlignment)
-
setAngleAlignment
public void setAngleAlignment(MarkerSymbol.AngleAlignment angleAlignment)
Sets the AngleAlignment of the Symbol.If
MAP
, the rotation will be relative to the map and will be affected by the map's rotation.If
SCREEN
, the rotation is relative to the user's screen and is unaffected by map's rotation.- Parameters:
angleAlignment
- the new AngleAlignment of the Symbol- Since:
- 100.0.0
- See Also:
getAngleAlignment()
-
getRotationType
@Deprecated public RotationType getRotationType()
Deprecated.As of 100.5.0. There is no other mechanism to specify the rotation type, but all angles are achievable by changing the value of the angle withsetAngle(float)
.Gets the RotationType of this Symbol.RotationType will describe how a Symbol will rotate relative to the x-axis or y-axis.
Default value is UNKNOWN.
- Returns:
- the RotationType of this Symbol
- Since:
- 100.0.0
- See Also:
setRotationType(com.esri.arcgisruntime.symbology.RotationType)
-
setRotationType
@Deprecated public void setRotationType(RotationType rotationType)
Deprecated.As of 100.5.0. There is no other mechanism to specify the rotation type, but all angles are achievable by changing the value of the angle withsetAngle(float)
.Sets the RotationType for this Symbol.If
ARITHMETIC
, the rotation is along the x-axis with positive rotation being counter-clockwise.If
GEOGRAPHIC
, the rotation is along the y-axis with positive rotation being clockwise.- Parameters:
rotationType
- the new RotationType, not null- Throws:
java.lang.IllegalArgumentException
- if input is null- Since:
- 100.0.0
-
getLeaderOffsetX
public float getLeaderOffsetX()
Gets the callout's leader x-offset. This is the number of density-independent pixels (dp) away from the Symbol's x coordinate point.Default value is 0.0.
- Returns:
- the offset of the callout's leader x coordinate in dp
- Since:
- 100.0.0
-
setLeaderOffsetX
public void setLeaderOffsetX(float offsetX)
Sets the callout's leader x-offset in density-independent pixels (dp). This x-offset is calculated by applying the given offset to the Symbol's initial x coordinate point.A positive number will cause the callout's leader to increase along the x-axis while a negative number will cause the callout's leader to decrease along the x-axis.
- Parameters:
offsetX
- the new offset in dp of the callout's leader x coordinate- Since:
- 100.0.0
-
getLeaderOffsetY
public float getLeaderOffsetY()
Gets the callout's leader y-offset. This is the number of density-independent pixels (dp) away from the y coordinate of the Symbol's y coordinate point.Default value is 0.0.
- Returns:
- the offset of the callout's leader y coordinate in dp
- Since:
- 100.0.0
-
setLeaderOffsetY
public void setLeaderOffsetY(float offsetY)
Sets the callout's leader y-offset in density-independent pixels (dp). This y-offset is calculated by applying the given offset to the Symbol's initial y coordinate point.A positive number will cause the callout's leader to rise along the y-axis while a negative number will cause the callout's leader to fall along the y-axis.
- Parameters:
offsetY
- the new offset in dp of the callout's leader y coordinate- Since:
- 100.0.0
- See Also:
getLeaderOffsetY()
-
getOffsetX
public float getOffsetX()
Gets the offset of the Symbol's x coordinate from its starting location. This is the number of density-independent pixels (dp) away from the Symbol's initial x coordinate point.Default value is 0.0.
- Returns:
- the offset of the Symbol's x coordinate in dp
- Since:
- 100.0.0
-
setOffsetX
public void setOffsetX(float offsetX)
Sets the offset of the Symbol's x coordinate from its starting location in density-independent pixels (dp).A positive number will cause the Symbol to increase along the x-axis while a negative number will cause the Symbol to decrease along the x-axis.
- Parameters:
offsetX
- the new offset in dp of the Symbol's x coordinate- Since:
- 100.0.0
-
getOffsetY
public float getOffsetY()
Gets the offset of the Symbol's y coordinate from its starting location. This is the number of density-independent pixels (dp) away from the Symbol's initial y coordinate point.Default value is 0.0.
- Returns:
- the offset of the Symbol's y coordinate in dp
- Since:
- 100.0.0
-
setOffsetY
public void setOffsetY(float offsetY)
Sets the offset of the Symbol's y coordinate from its starting location in density-independent pixels (dp).A positive number will cause the Symbol to rise along the y-axis while a negative number will cause the Symbol to fall along the y-axis.
- Parameters:
offsetY
- the new offset in dp of the Symbol's y coordinate- Since:
- 100.0.0
-
-