public abstract class Marker extends TextureProvider
A class to encapsulate graphical and positioning information for bitmaps to be displayed on the MapView
.
Modifier and Type | Class and Description |
---|---|
static class |
Marker.CollisionType |
static interface |
Marker.MarkerListener
A listener for receiving events from a
Marker |
TextureProvider.OverlayType
Modifier | Constructor and Description |
---|---|
protected |
Marker(float positionX,
float positionY)
Constructs a Marker with at the given position.
|
protected |
Marker(float positionX,
float positionY,
float anchorX,
float anchorY)
Constructs a Marker with anchors.
|
protected |
Marker(float positionX,
float positionY,
float anchorX,
float anchorY,
float weight)
Constructs a Marker with anchors and a weight.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canBeSelected()
If a marker can be selected, when a user taps on it a callout panel will be shown and a pin will be placed on top of the marker.
|
float |
getAlpha() |
float[] |
getAnchor()
Get anchor for this Marker.
|
java.lang.String |
getCalloutDetails()
Detail text to show on the callout panel
|
java.lang.String |
getCalloutTitle()
Title text to show on the callout panel
|
boolean |
getCollision() |
Marker.CollisionType |
getCollisionCondition()
Function used to get what type of collision is used by highlighted marker for clustering.
|
java.lang.String |
getDetails()
Get the details of this marker.
|
MapInfo.ZoomLevel |
getMaxZoomLevel()
The maximum zoom level that this Marker should be visible.
|
MapInfo.ZoomLevel |
getMinZoomLevel()
The minimum zoom level that this Marker should be visible.
|
java.lang.String |
getName()
Get the name of this marker.
|
float[] |
getPosition()
Get the pixel position of this marker.
|
boolean |
getRotationFixedToMap() |
boolean |
getScaleFixedToMap() |
float |
getWeight()
Get weight of this Marker.
|
float |
getXScale() |
float |
getYScale() |
void |
invalidate()
Called to indicate that this Marker has been updated.
|
void |
invalidate(boolean invalidateBitmap)
Called to indicate that this Marker has been updated.
|
boolean |
isDisabled()
Returns true if the marker is disabled.
|
void |
onTapped()
Called to indicate that this marker has been tapped by the user.
|
void |
setAlpha(float alpha)
Set if the alpha modifier of the Marker, 0.0 to 1.0 where 0 is transparent and 1 is opaque.
|
void |
setAnchor(float anchorX,
float anchorY)
Sets the anchor point of this marker.
|
void |
setCollision(boolean allowCollision)
Set if the Marker is included in collision checking and not drawn when another higher weight marker occludes it.
|
void |
setCollisionCondition(Marker.CollisionType newCollisionCondition)
Set if the Marker allows collision with identical weight markers (currently used for HighlightedMarkers only).
|
void |
setDetails(java.lang.String details)
Set the details of this marker.
|
void |
setDisabled(boolean disabled)
Sets if the marker is disabled.
|
void |
setListener(Marker.MarkerListener listener)
Sets the listener for this marker.
|
void |
setMaxZoomLevel(MapInfo.ZoomLevel maxZoomLevel)
Sets the maximum zoom level that this Marker should be visible.
|
void |
setMinZoomLevel(MapInfo.ZoomLevel minZoomLevel)
The minimum zoom level that this Marker should be visible.
|
void |
setName(java.lang.String name)
Set the name of this marker.
|
void |
setPosition(float positionX,
float positionY)
Sets the pixel position of this markers anchor.
|
void |
setRotationFixedToMap(boolean rotationFixedToMap)
Set if the Marker’s rotation is fixed to the map.
|
void |
setScaleFixedToMap(boolean scaleFixedToMap)
Set if the Marker’s scale is fixed to the map.
|
void |
setShowsCallout(boolean showsCallout)
Set if this marker should display a callout when tapped.
|
void |
setWeight(float weight)
Sets the weight of this marker, the weight is used in sorting the results of collision tests.
|
void |
setXScale(float scale)
Set if the scale modifier of the Marker in the x coordinate.
|
void |
setYScale(float scale)
Set if the scale modifier of the Marker in the y coordinate.
|
boolean |
showsCallout() |
boolean |
showsPinMarker()
If a marker can be selected, this will determine if a pin marker will be placed on top of it when the user selects it.
|
getBitmap, getId, getNativeBitmap, getOverlayColor, getOverlayColorInterface, getOverlayFillColor, getOverlayFillColorInterface, getOverlayPoints, getOverlayPointsInterface, getOverlayType, getOverlayTypeInterface, getOverlayWidth, getOverlayWidthInterface, getSize, overlayClosed, setSize
protected Marker(float positionX, float positionY)
Constructs a Marker with at the given position.
positionX
- The x position of this markers anchor.positionY
- The y position of this markers anchor.protected Marker(float positionX, float positionY, float anchorX, float anchorY)
Constructs a Marker with anchors.
positionX
- The x position of this markers anchor.positionY
- The y position of this markers anchor.anchorX
- The x position of the anchor within this marker [0.0:1.0]anchorY
- The y position of the anchor within this marker [0.0:1.0]protected Marker(float positionX, float positionY, float anchorX, float anchorY, float weight)
Constructs a Marker with anchors and a weight.
positionX
- The x position of this markers anchor.positionY
- The y position of this markers anchor.anchorX
- The x position of the anchor within this marker [0.0:1.0]anchorY
- The y position of the anchor within this marker [0.0:1.0]weight
- The weight of this marker, weight is used as a multiplier when sorting markers during collision tests.public boolean canBeSelected()
If a marker can be selected, when a user taps on it a callout panel will be shown and a pin will be placed on top of the marker. It’s true by default. Override to change this behavior.
public boolean showsPinMarker()
If a marker can be selected, this will determine if a pin marker will be placed on top of it when the user selects it.
public void setListener(Marker.MarkerListener listener)
Sets the listener for this marker.
public void setAnchor(float anchorX, float anchorY)
Sets the anchor point of this marker.
anchorX
- A value between 0 and 1, with 0.5 being the horizontal center of this markers bitmap.anchorY
- A value between 0 and 1, with 0.5 being the vertical center of this markers bitmap.public void setPosition(float positionX, float positionY)
Sets the pixel position of this markers anchor.
public void setWeight(float weight)
Sets the weight of this marker, the weight is used in sorting the results of collision tests. Higher weight values with show up on top of lower values.
public float getWeight()
Get weight of this Marker.
public float[] getAnchor()
Get anchor for this Marker.
public float[] getPosition()
Get the pixel position of this marker.
public java.lang.String getName()
Get the name of this marker.
public void setName(java.lang.String name)
Set the name of this marker.
public java.lang.String getDetails()
Get the details of this marker. Second line of text in the callout
public void setDetails(java.lang.String details)
Set the details of this marker.
public java.lang.String getCalloutTitle()
Title text to show on the callout panel
public java.lang.String getCalloutDetails()
Detail text to show on the callout panel
public boolean showsCallout()
public void setShowsCallout(boolean showsCallout)
Set if this marker should display a callout when tapped.
public boolean getCollision()
public void setCollision(boolean allowCollision)
Set if the Marker is included in collision checking and not drawn when another higher weight marker occludes it.
public Marker.CollisionType getCollisionCondition()
Function used to get what type of collision is used by highlighted marker for clustering. Currently only equal weight is supported. Default is no clustering.
public void setCollisionCondition(Marker.CollisionType newCollisionCondition)
Set if the Marker allows collision with identical weight markers (currently used for HighlightedMarkers only).
public MapInfo.ZoomLevel getMaxZoomLevel()
The maximum zoom level that this Marker should be visible.
public void setMaxZoomLevel(MapInfo.ZoomLevel maxZoomLevel)
Sets the maximum zoom level that this Marker should be visible.
public MapInfo.ZoomLevel getMinZoomLevel()
The minimum zoom level that this Marker should be visible.
public void setMinZoomLevel(MapInfo.ZoomLevel minZoomLevel)
The minimum zoom level that this Marker should be visible.
public void setRotationFixedToMap(boolean rotationFixedToMap)
Set if the Marker’s rotation is fixed to the map.
public boolean getRotationFixedToMap()
public void setScaleFixedToMap(boolean scaleFixedToMap)
Set if the Marker’s scale is fixed to the map.
public boolean getScaleFixedToMap()
public float getXScale()
public void setXScale(float scale)
Set if the scale modifier of the Marker in the x coordinate.
public float getYScale()
public void setYScale(float scale)
Set if the scale modifier of the Marker in the y coordinate.
public float getAlpha()
public void setAlpha(float alpha)
Set if the alpha modifier of the Marker, 0.0 to 1.0 where 0 is transparent and 1 is opaque.
public boolean isDisabled()
Returns true if the marker is disabled.
public void setDisabled(boolean disabled)
Sets if the marker is disabled.
public void onTapped()
Called to indicate that this marker has been tapped by the user.
public void invalidate()
Called to indicate that this Marker has been updated.
public void invalidate(boolean invalidateBitmap)
Called to indicate that this Marker has been updated.
invalidateBitmap
- True if the bitmap needs to be updated as well as the properties.