Class MarkerOptions
java.lang.Object
com.codename1.maps.MarkerOptions
A fluent builder describing a Marker before it is added to a
MapSurface. Only the position is required; every other property has a
sensible default.
map.addMarker(new MarkerOptions(new LatLng(37.78, -122.40))
.icon(pin)
.title("Union Square")
.anchor(0.5f, 1.0f)
.onClick(e -> showDetails()));
-
Constructor Summary
ConstructorsConstructorDescriptionStarts a builder with the location supplied later viaposition.MarkerOptions(LatLng position) Starts a builder for a marker atposition. -
Method Summary
Modifier and TypeMethodDescriptionanchor(float u, float v) Sets the icon anchor in normalized [0,1] image space.build()Builds an immutable-by-conventionMarkerfrom this builder.draggable(boolean draggable) Makes the marker draggable (native providers only).icon(EncodedImage icon) Sets the marker icon.onClick(ActionListener onClick) Sets the tap listener.Sets the marker location.Sets the info-window secondary text.Sets the info-window title.
-
Constructor Details
-
MarkerOptions
Starts a builder for a marker atposition. -
MarkerOptions
public MarkerOptions()Starts a builder with the location supplied later viaposition.
-
-
Method Details
-
position
Sets the marker location. -
icon
Sets the marker icon. Whennullthe surface renders its default pin. -
title
Sets the info-window title. -
snippet
Sets the info-window secondary text. -
anchor
Sets the icon anchor in normalized [0,1] image space. -
draggable
Makes the marker draggable (native providers only). -
onClick
Sets the tap listener. -
build
-