Class Marker
java.lang.Object
com.codename1.maps.MapObject
com.codename1.maps.Marker
A marker pinned to a geographic location on a map. Create one from a
MarkerOptions via MapSurface.addMarker(MarkerOptions); the returned
instance is a live handle whose mutators (setPosition(LatLng), setVisible(boolean))
update the rendered marker on the next repaint.-
Method Summary
Modifier and TypeMethodDescriptionfloatThe horizontal icon anchor in normalized [0,1] image space (0 = left, 1 = right).floatThe vertical icon anchor in normalized [0,1] image space (0 = top, 1 = bottom).getIcon()The marker icon, ornullto use the surface's default pin.The listener invoked when the marker is tapped, ornull.The marker location.The secondary text shown beneath the title (provider dependent).getTitle()The marker title shown in an info window (provider dependent).booleanWhether the user may drag this marker (native providers only).booleanWhether the marker is currently rendered.voidsetPosition(LatLng position) Moves the marker to a new location.voidsetVisible(boolean visible) Shows or hides the marker.
-
Method Details
-
getPosition
The marker location. -
setPosition
Moves the marker to a new location. -
getIcon
The marker icon, ornullto use the surface's default pin. -
getTitle
The marker title shown in an info window (provider dependent). -
getSnippet
The secondary text shown beneath the title (provider dependent). -
getAnchorU
public float getAnchorU()The horizontal icon anchor in normalized [0,1] image space (0 = left, 1 = right). Defaults to 0.5 (centered). -
getAnchorV
public float getAnchorV()The vertical icon anchor in normalized [0,1] image space (0 = top, 1 = bottom). Defaults to 1 (pin tip at the location). -
isDraggable
public boolean isDraggable()Whether the user may drag this marker (native providers only). -
isVisible
public boolean isVisible()Whether the marker is currently rendered. -
setVisible
public void setVisible(boolean visible) Shows or hides the marker. -
getOnClick
The listener invoked when the marker is tapped, ornull.
-