public class Placemark extends AbstractRenderable implements Highlightable, Movable
setEnableLeaderPicking(boolean)
.
Placemarks may be drawn with either an image or as single-color square with a specified size. When the placemark
attributes indicate a valid image, the placemark's image is drawn as a rectangle in the image's original dimensions,
scaled by the image scale attribute. Otherwise, the placemark is drawn as a square with width and height equal to the
value of the image scale attribute, in pixels, and color equal to the image color attribute.Modifier and Type | Class and Description |
---|---|
static interface |
Placemark.LevelOfDetailSelector
Presents an interfaced for dynamically determining the PlacemarkAttributes based on the distance between the
placemark and the camera.
|
Constructor and Description |
---|
Placemark(Position position)
Constructs a Placemark that draws its representation at the supplied position using default
PlacemarkAttributes bundle. |
Placemark(Position position,
PlacemarkAttributes attributes)
Constructs a Placemark that draws its representation at the supplied position using the given
PlacemarkAttributes bundle. |
Placemark(Position position,
PlacemarkAttributes attributes,
java.lang.String name)
Constructs a Placemark with a label that draws its representation at the supplied position using the given
PlacemarkAttributes bundle. |
Modifier and Type | Method and Description |
---|---|
static Placemark |
createWithColorAndSize(Position position,
Color color,
int pixelSize)
This factory method creates a Placemark and an associated PlacemarkAttributes bundle that draws a simple square
centered on the supplied position with the given size and color.
|
static Placemark |
createWithImage(Position position,
ImageSource imageSource)
This factory method creates a Placemark and an associated PlacemarkAttributes bundle that draws the given image
centered on the supplied position.
|
int |
getAltitudeMode()
Returns the placemark's altitude mode.
|
PlacemarkAttributes |
getAttributes()
Gets the placemark's "normal" attributes, that is the attributes used when the placemark's highlighted flag is
false.
|
double |
getEyeDistanceScalingLabelThreshold()
Gets the eye altitude, in meters, above which this placemark's label is not displayed.
|
double |
getEyeDistanceScalingThreshold()
Gets the eye distance above which to reduce the size of this placemark, in meters.
|
PlacemarkAttributes |
getHighlightAttributes()
Gets the attributes used when this placemark's highlighted flag is true.
|
double |
getImageRotation()
Gets the amount of rotation to apply to the image, measured in degrees clockwise and relative to this placemark's
getImageRotationReference() . |
int |
getImageRotationReference()
Gets the type of rotation to apply if the
getImageRotation() is not zero. |
double |
getImageTilt()
Gets the amount of tilt to apply to the image, measured in degrees away from the eye point and relative to this
placemark's
getImageTiltReference() . |
int |
getImageTiltReference()
Gets the type tilt to apply when
getImageTilt() is non-zero. |
Placemark.LevelOfDetailSelector |
getLevelOfDetailSelector()
gets the current level-of-detail selector used to inject logic for selecting PlacemarkAttributes based on the the
camera distance and highlighted attribute.
|
Position |
getPosition()
Gets this placemark's geographic position.
|
Position |
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.
|
boolean |
isEnableLeaderPicking()
Indicates if picking is allowed on this placemark's (optional) leader.
|
boolean |
isEyeDistanceScaling()
Indicates whether this placemark's size is reduced at higher eye distances.
|
boolean |
isHighlighted()
Indicates whether this placemark uses its highlight attributes rather than its normal attributes.
|
void |
moveTo(Globe globe,
Position position)
Moves the shape over the globe's surface.
|
Placemark |
setAltitudeMode(int altitudeMode)
Sets this placemark's altitude mode.
|
Placemark |
setAttributes(PlacemarkAttributes attributes)
Sets the placemark's attributes to the supplied attributes bundle.
|
Placemark |
setEnableLeaderPicking(boolean enableLeaderPicking)
Sets whether picking is allowed on this placemark's (optional) leader.
|
Placemark |
setEyeDistanceScaling(boolean eyeDistanceScaling)
Enables or disables the eye distance scaling feature for this placemark.
|
Placemark |
setEyeDistanceScalingLabelThreshold(double eyeDistanceScalingLabelThreshold)
Sets the eye altitude, in meters, above which this placemark's label is not displayed.
|
Placemark |
setEyeDistanceScalingThreshold(double eyeDistanceScalingThreshold)
Sets the eye distance above which to reduce the size of this placemark, in meters.
|
Placemark |
setHighlightAttributes(PlacemarkAttributes highlightAttributes)
Sets the attributes used when this placemark's highlighted flag is true.
|
void |
setHighlighted(boolean highlighted)
Sets the highlighted state of this placemark, which indicates whether this placemark uses its highlight
attributes rather than its normal attributes.
|
Placemark |
setImageRotation(double imageRotation)
Sets the amount of rotation to apply to the image, measured in degrees clockwise and relative to this placemark's
getImageRotationReference() . |
Placemark |
setImageRotationReference(int imageRotationReference)
Sets the type of rotation to apply if the
getImageRotation() is not zero. |
Placemark |
setImageTilt(double imageTilt)
Sets the amount of tilt to apply to the image, measured in degrees away from the eye point and relative to this
placemark's
getImageTiltReference() . |
Placemark |
setImageTiltReference(int imageTiltReference)
Sets the type tilt to apply when
getImageTilt() is non-zero. |
Placemark |
setLevelOfDetailSelector(Placemark.LevelOfDetailSelector levelOfDetailSelector)
Sets the optional level-of-detail selector used to inject logic for selecting PlacemarkAttributes based on the
the camera distance and highlighted attribute.
|
Placemark |
setPosition(Position position)
Sets this placemark's geographic position to the values in the supplied position.
|
getDisplayName, getPickDelegate, getUserProperty, hasUserProperty, isEnabled, putUserProperty, removeUserProperty, render, setDisplayName, setEnabled, setPickDelegate
public Placemark(Position position)
PlacemarkAttributes
bundle. The displayName and label properties are empty.position
- The placemark's geographic positionpublic Placemark(Position position, PlacemarkAttributes attributes)
PlacemarkAttributes
bundle. The displayName and label properties are empty.position
- The placemark's geographic positionattributes
- The attributes bundle reference that defines how the placemark is drawnpublic Placemark(Position position, PlacemarkAttributes attributes, java.lang.String name)
PlacemarkAttributes
bundle. The displayName is set to the supplied name string.position
- The placemark's geographic positionattributes
- The attributes to associate with this placemark. May be null, but if null the placemark will
not be drawn.name
- The text for the AbstractRenderable.displayName
.public static Placemark createWithColorAndSize(Position position, Color color, int pixelSize)
position
- The geographic position where the placemark is drawn.color
- The color of the placemark.pixelSize
- The width and height of the placemark.public static Placemark createWithImage(Position position, ImageSource imageSource)
position
- The geographic position with the placemark is drawn.imageSource
- The object containing the image that is drawn.public Position getPosition()
public Placemark setPosition(Position position)
position
- The new position where this placemark will be drawnpublic int getAltitudeMode()
public Placemark setAltitudeMode(int altitudeMode)
altitudeMode
- The new altitude mode. See WorldWind.AltitudeMode
for acceptable
valuespublic PlacemarkAttributes getAttributes()
public Placemark setAttributes(PlacemarkAttributes attributes)
attributes
- A reference to an attributes bundle used by this placemark when not highlighted.public PlacemarkAttributes getHighlightAttributes()
public Placemark setHighlightAttributes(PlacemarkAttributes highlightAttributes)
highlightAttributes
- A reference to the attributes bundle used by this placemark when highlightedpublic Placemark.LevelOfDetailSelector getLevelOfDetailSelector()
public Placemark setLevelOfDetailSelector(Placemark.LevelOfDetailSelector levelOfDetailSelector)
levelOfDetailSelector
- The new level-of-detail selected; may be nullpublic boolean isEyeDistanceScaling()
getEyeDistanceScalingThreshold()
property. When the eye distance is below the threshold, this
placemark is scaled only according to the PlacemarkAttributes.getImageScale()
.public Placemark setEyeDistanceScaling(boolean eyeDistanceScaling)
getEyeDistanceScalingThreshold()
property. When the eye distance is below the threshold, this placemark is scaled only according to the PlacemarkAttributes.getImageScale()
.eyeDistanceScaling
- The new state for the eye distance scaling feature.public double getEyeDistanceScalingThreshold()
isEyeDistanceScaling()
is true, this placemark's image, label and leader sizes are reduced as the eye
distance increases beyond this threshold.public Placemark setEyeDistanceScalingThreshold(double eyeDistanceScalingThreshold)
isEyeDistanceScaling()
is true, this placemark's image, label and leader sizes are reduced as the eye
distance increases beyond this threshold.eyeDistanceScalingThreshold
- The new threshold value, in meters, used to determine if eye distance scaling
should be applied.public double getEyeDistanceScalingLabelThreshold()
public Placemark setEyeDistanceScalingLabelThreshold(double eyeDistanceScalingLabelThreshold)
eyeDistanceScalingLabelThreshold
- The new threshold value, in meters, used to determine if eye distance
label scaling should be applied.public double getImageRotation()
getImageRotationReference()
.public Placemark setImageRotation(double imageRotation)
getImageRotationReference()
.imageRotation
- The amount in degrees to rotate the image. Zero is no rotation.public int getImageRotationReference()
getImageRotation()
is not zero. This value indicates
whether to apply this placemark's image rotation relative to the screen or the globe.
If WorldWind.RELATIVE_TO_SCREEN
, this placemark's image is rotated in the plane of the screen and its
orientation relative to the globe changes as the view changes. If WorldWind.RELATIVE_TO_GLOBE
, this
placemark's image is rotated in a plane tangent to the globe at this placemark's position and retains its
orientation relative to the globe.WorldWind.OrientationMode
to use when image rotation applied.public Placemark setImageRotationReference(int imageRotationReference)
getImageRotation()
is not zero. This value indicates
whether to apply this placemark's image rotation relative to the screen or the globe.
If WorldWind.RELATIVE_TO_SCREEN
, this placemark's image is rotated in the plane of the screen and its
orientation relative to the globe changes as the view changes. If WorldWind.RELATIVE_TO_GLOBE
, this
placemark's image is rotated in a plane tangent to the globe at this placemark's position and retains its
orientation relative to the globe.imageRotationReference
- The WorldWind.OrientationMode
to use when image rotation
applied.public double getImageTilt()
getImageTiltReference()
. While any positive or negative number may be specified,
values outside the range [0. 90] cause some or all of the image to be clipped.public Placemark setImageTilt(double imageTilt)
getImageTiltReference()
. While any positive or negative number may be specified,
values outside the range [0. 90] cause some or all of the image to be clipped.imageTilt
- The amount, in degrees, to tilt the image.public int getImageTiltReference()
getImageTilt()
is non-zero. This value indicates whether to
apply this placemark's image tilt relative to the screen or the globe.
If WorldWind.RELATIVE_TO_SCREEN
, this placemark's image is tilted inwards (for positive tilts) relative
to the plane of the screen, and its orientation relative to the globe changes as the view changes. If WorldWind.RELATIVE_TO_GLOBE
, this placemark's image is tilted towards the globe's surface, and retains its
orientation relative to the surface.WorldWind.OrientationMode
to use when the image is tilted.public Placemark setImageTiltReference(int imageTiltReference)
getImageTilt()
is non-zero. This value indicates whether to
apply this placemark's image tilt relative to the screen or the globe.
If WorldWind.RELATIVE_TO_SCREEN
, this placemark's image is tilted inwards (for positive tilts) relative
to the plane of the screen, and its orientation relative to the globe changes as the view changes. If WorldWind.RELATIVE_TO_GLOBE
, this placemark's image is tilted towards the globe's surface, and retains its
orientation relative to the surface.imageTiltReference
- The WorldWind.OrientationMode
to use when the image is
tilted.public boolean isEnableLeaderPicking()
public Placemark setEnableLeaderPicking(boolean enableLeaderPicking)
enableLeaderPicking
- true if leader picking should be enabled, otherwise falsepublic boolean isHighlighted()
isHighlighted
in interface Highlightable
public void setHighlighted(boolean highlighted)
setHighlighted
in interface Highlightable
highlighted
- The highlighted state applied to this placemark.public Position getReferencePosition()
getReferencePosition
in interface Movable
getPosition()
public void moveTo(Globe globe, Position position)
setPosition(Position)
.