Package com.arubanetworks.meridian.maps
Class Marker
java.lang.Object
com.arubanetworks.meridian.maprender.TextureProvider
com.arubanetworks.meridian.maps.Marker
- Direct Known Subclasses:
ClusteredMarker
,FlatPlacemarkMarker
,HighlightedMarkers
,LocationMarker
,OverlayMarker
,PlacemarkMarker
,SelectedPinMarker
,TagMarker
A class to encapsulate graphical and positioning information for bitmaps to be displayed on the
MapView
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static interface
A listener for receiving events from aMarker
Nested classes/interfaces inherited from class com.arubanetworks.meridian.maprender.TextureProvider
TextureProvider.OverlayType
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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[]
Get anchor for this Marker.Detail text to show on the callout panelTitle text to show on the callout panelboolean
Function used to get what type of collision is used by highlighted marker for clustering.Get the details of this marker.Gets the bitmap to be used as the drop shadow.The maximum zoom level that this Marker should be visible.The minimum zoom level that this Marker should be visible.getName()
Get the name of this marker.float[]
Get the pixel position of this marker.boolean
boolean
float
Get weight of this Marker.float
float
void
Called to indicate that this Marker has been updated.void
invalidate
(boolean invalidateBitmap) Called to indicate that this Marker has been updated.boolean
Returns true if the marker is disabled.boolean
Returns true if drag and drop for this the marker is enabled.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
(String details) Set the details of this marker.void
setDisabled
(boolean disabled) Sets if the marker is disabled.void
setDragDropEnabled
(boolean enabled) Sets if drag and drop for this the marker is enabled.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
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
boolean
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.Methods inherited from class com.arubanetworks.meridian.maprender.TextureProvider
getBitmap, getId, getNativeBitmap, getOverlayColor, getOverlayColorInterface, getOverlayFillColor, getOverlayFillColorInterface, getOverlayPoints, getOverlayPointsInterface, getOverlayType, getOverlayTypeInterface, getOverlayWidth, getOverlayWidthInterface, getSize, overlayClosed, setSize
-
Constructor Details
-
Marker
protected Marker(float positionX, float positionY) Constructs a Marker with at the given position.- Parameters:
positionX
- The x position of this markers anchor.positionY
- The y position of this markers anchor.
-
Marker
protected Marker(float positionX, float positionY, float anchorX, float anchorY) Constructs a Marker with anchors.- Parameters:
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]
-
Marker
protected Marker(float positionX, float positionY, float anchorX, float anchorY, float weight) Constructs a Marker with anchors and a weight.- Parameters:
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.
-
-
Method Details
-
canBeSelected
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.
- Returns:
- true if the marker can be selected, false if it cannot
-
showsPinMarker
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.- Returns:
- true if we want to show a pin marker on top the marker, false otherwise
-
setListener
Sets the listener for this marker. -
setAnchor
public void setAnchor(float anchorX, float anchorY) Sets the anchor point of this marker.- Parameters:
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.
-
setPosition
public void setPosition(float positionX, float positionY) Sets the pixel position of this markers anchor. -
setWeight
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.
-
getWeight
public float getWeight()Get weight of this Marker. -
getAnchor
public float[] getAnchor()Get anchor for this Marker.- Returns:
- An array of two floats anchorX and anchorY.
-
getPosition
public float[] getPosition()Get the pixel position of this marker.- Returns:
- An array of two floats positionX and positionY.
-
getName
Get the name of this marker. -
setName
Set the name of this marker. -
getDetails
Get the details of this marker.Second line of text in the callout
-
setDetails
Set the details of this marker. -
getCalloutTitle
Title text to show on the callout panel -
getCalloutDetails
Detail text to show on the callout panel -
showsCallout
public boolean showsCallout()- Returns:
- True if the Marker should display a callout automatically when tapped.
-
setShowsCallout
public void setShowsCallout(boolean showsCallout) Set if this marker should display a callout when tapped. -
getCollision
public boolean getCollision()- Returns:
- True if the Marker is included in collision checking and not drawn when another higher weight marker occludes it.
-
setCollision
public void setCollision(boolean allowCollision) Set if the Marker is included in collision checking and not drawn when another higher weight marker occludes it. -
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.
- Returns:
- the type of collision that triggers clustering for highlighted markers
-
setCollisionCondition
Set if the Marker allows collision with identical weight markers (currently used for HighlightedMarkers only). -
getMaxZoomLevel
The maximum zoom level that this Marker should be visible. -
setMaxZoomLevel
Sets the maximum zoom level that this Marker should be visible. -
getMinZoomLevel
The minimum zoom level that this Marker should be visible. -
setMinZoomLevel
The minimum zoom level that this Marker should be visible. -
setRotationFixedToMap
public void setRotationFixedToMap(boolean rotationFixedToMap) Set if the Marker’s rotation is fixed to the map. -
getRotationFixedToMap
public boolean getRotationFixedToMap()- Returns:
- True if the markers rotation is fixed to the rotation of the map, False if the markers rotation is fixed to the view.
-
setScaleFixedToMap
public void setScaleFixedToMap(boolean scaleFixedToMap) Set if the Marker’s scale is fixed to the map. -
getScaleFixedToMap
public boolean getScaleFixedToMap()- Returns:
- True if the markers scale is fixed to the scale of the map, False if the markers scale is fixed to the view.
-
getXScale
public float getXScale()- Returns:
- The scale modifier of the Marker in the x coordinate.
-
setXScale
public void setXScale(float scale) Set if the scale modifier of the Marker in the x coordinate. -
getYScale
public float getYScale()- Returns:
- The scale modifier of the Marker in the y coordinate.
-
setYScale
public void setYScale(float scale) Set if the scale modifier of the Marker in the y coordinate. -
getAlpha
public float getAlpha()- Returns:
- The alpha modifier of the Marker.
-
setAlpha
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. -
isDisabled
public boolean isDisabled()Returns true if the marker is disabled. -
setDisabled
public void setDisabled(boolean disabled) Sets if the marker is disabled. -
isDragDropEnabled
public boolean isDragDropEnabled()Returns true if drag and drop for this the marker is enabled. -
setDragDropEnabled
public void setDragDropEnabled(boolean enabled) Sets if drag and drop for this the marker is enabled. -
onTapped
public void onTapped()Called to indicate that this marker has been tapped by the user. -
invalidate
public void invalidate()Called to indicate that this Marker has been updated. -
invalidate
public void invalidate(boolean invalidateBitmap) Called to indicate that this Marker has been updated.- Parameters:
invalidateBitmap
- True if the bitmap needs to be updated as well as the properties.
-
getDropShadowBitmap
Gets the bitmap to be used as the drop shadow.Override to use a custom drop shadow.
-