public class MarkerView extends Marker
This class uses MapboxMap.MarkerViewAdapter to adapt a
MarkerView model to an Android SDK View object.
An InfoWindow can be shown when a MarkerView is pressed
mapboxMap, mapView| Constructor and Description |
|---|
MarkerView(BaseMarkerViewOptions baseMarkerViewOptions)
Creates a instance of MarkerView using the builder of MarkerView
|
| Modifier and Type | Method and Description |
|---|---|
float |
getAlpha()
Get the alpha value of the MarkerView.
|
float |
getAnchorU()
Get the horizontal distance, normalized to [0, 1], of the anchor from the left edge.
|
float |
getAnchorV()
Get the vertical distance, normalized to [0, 1], of the anchor from the top edge.
|
Icon |
getIcon()
Get the icon of the MarkerView.
|
float |
getInfoWindowAnchorU()
Get the horizontal distance, normalized to [0, 1], of the info window anchor from the left edge.
|
float |
getInfoWindowAnchorV()
Get the vertical distance, normalized to [0, 1], of the info window anchor from the top edge.
|
float |
getRotation()
Get the rotation value of the MarkerView.
|
boolean |
isFlat()
Get the flat state of a MarkerView.
|
boolean |
isSelected() |
boolean |
isVisible()
Returns the visible state of the MarkerView.
|
void |
setAlpha(float alpha)
Set the alpha value of the MarkerView.
|
void |
setAnchor(float u,
float v)
Specifies the anchor being set on a particular point point of the MarkerView.
|
void |
setFlat(boolean flat)
Sets whether this marker should be flat against the map true or a billboard facing the camera false.
|
void |
setIcon(Icon icon)
Set the icon of the MarkerView.
|
void |
setInfoWindowAnchor(float u,
float v)
Specifies the anchor point of the info window on the View of the MarkerView.
|
void |
setMapboxMap(MapboxMap mapboxMap)
Set the MapboxMap associated tot the MapView containing the MarkerView.
|
void |
setPosition(LatLng position)
Sets the position.
|
void |
setRotation(float rotation)
Set the rotation value of the MarkerView.
|
void |
setVisible(boolean visible)
Set the visible state of a MarkerView.
|
java.lang.String |
toString()
Get the String representation of a MarkerView.
|
getInfoWindow, getPosition, getSnippet, getTitle, hideInfoWindow, isInfoWindowShown, setRightOffsetPixels, setSnippet, setTitle, setTopOffsetPixels, showInfoWindowcompareTo, equals, getId, getMapboxMap, getMapView, hashCode, remove, setId, setMapViewpublic MarkerView(BaseMarkerViewOptions baseMarkerViewOptions)
baseMarkerViewOptions - the builder used to construct the MarkerViewpublic void setAnchor(float u,
float v)
The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0], where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
u - u-coordinate of the anchor, as a ratio of the image width (in the range [0, 1])v - v-coordinate of the anchor, as a ratio of the image height (in the range [0, 1])public float getAnchorU()
public float getAnchorV()
public void setInfoWindowAnchor(float u,
float v)
This is specified in the same coordinate system as the anchor.
The default is the top middle of the View.
u - u-coordinate of the info window anchor, as a ratio of the image width (in the range [0, 1])v - v-coordinate of the info window anchor, as a ratio of the image height (in the range [0, 1])for more details.public float getInfoWindowAnchorU()
public float getInfoWindowAnchorV()
public boolean isFlat()
public void setFlat(boolean flat)
flat - the flat state of the MarkerViewpublic void setVisible(boolean visible)
visible - true will make the MarkerView visible, false will hide the MarkerViewspublic boolean isVisible()
public void setRotation(float rotation)
This will result in animating the rotation of the MarkerView using an rotation animator from current value to the provided parameter value.
rotation - the rotation value to animate topublic float getRotation()
public float getAlpha()
public void setAlpha(float alpha)
This will result in animating the alpha of the MarkerView using an alpha animator from current value to the provided parameter value.
alpha - the alpha value to animate topublic void setIcon(Icon icon)
public void setPosition(LatLng position)
MarkersetPosition in class Markerposition - new positionpublic boolean isSelected()
public Icon getIcon()
public void setMapboxMap(MapboxMap mapboxMap)
This method is used to instantiate the MarkerView and provide an instance of MapboxMap.MarkerViewAdapter
setMapboxMap in class AnnotationmapboxMap - the MapboxMap instances