public final class MarkerOptions extends Object
Constructor and Description |
---|
MarkerOptions()
Creates a new set of marker options.
|
Modifier and Type | Method and Description |
---|---|
MarkerOptions |
anchor(float u,
float v)
Specifies the anchor to be at a particular point in the marker image.
|
MarkerOptions |
draggable(boolean draggable)
Sets the draggability for the marker.
|
float |
getAnchorU()
Horizontal distance, normalized to [0, 1], of the anchor from the left edge.
|
float |
getAnchorV()
Vertical distance, normalized to [0, 1], of the anchor from the left edge.
|
GridPoint |
getGridPoint() |
BitmapDescriptor |
getIcon()
Gets the custom icon set for this MarkerOptions object.
|
String |
getSnippet()
Gets the snippet set for this MarkerOptions object.
|
String |
getTitle()
Gets the title set for this MarkerOptions object.
|
MarkerOptions |
gridPoint(GridPoint gp)
Sets the location for the marker.
|
MarkerOptions |
icon(BitmapDescriptor icon)
Sets the icon for the marker.
|
boolean |
isDraggable()
Gets the draggability setting for this MarkerOptions object.
|
boolean |
isVisible()
Gets the visibility setting for this MarkerOptions object.
|
MarkerOptions |
snippet(String snippet)
Sets the snippet for the marker.
|
MarkerOptions |
title(String title)
Sets the title for the marker.
|
MarkerOptions |
visible(boolean visible)
Sets the visibility for the marker.
|
public MarkerOptions anchor(float u, float v)
The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface. 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. The anchoring point in a W x H image is the nearest discrete grid point in a (W + 1) x (H + 1) grid, obtained by scaling the then rounding. For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).
*-----+-----+-----+-----*
| | | | |
| | | | |
+-----+-----+-----+-----+
| | | X | | (U, V) = (0.7, 0.6)
| | | | |
*-----+-----+-----+-----*
*-----+-----+-----+-----*
| | | | |
| | | | |
+-----+-----+-----X-----+ (X, Y) = (3, 1)
| | | | |
| | | | |
*-----+-----+-----+-----*
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 MarkerOptions gridPoint(GridPoint gp)
public GridPoint getGridPoint()
public MarkerOptions icon(BitmapDescriptor icon)
icon
- if null, the default marker is used.public MarkerOptions title(String title)
title
- public MarkerOptions snippet(String snippet)
public MarkerOptions visible(boolean visible)
public MarkerOptions draggable(boolean draggable)
public BitmapDescriptor getIcon()
public String getTitle()
public String getSnippet()
public boolean isVisible()
public boolean isDraggable()
Copyright © 2012–2013 Ordnance Survey. All rights reserved.