public final class MarkerLayer
extends java.lang.Object
Marker
's.Modifier and Type | Method and Description |
---|---|
void |
addMarker(Marker marker)
Adds the given
Marker to this layer and the map. |
Marker |
createMarkerAt(double latitude,
double longitude)
Creates a new
Marker at the given coordinates. |
Marker |
createMarkerFrom(android.os.Parcel in)
Creates a new
Marker using the given Parcel . |
java.lang.String |
getIconPath() |
long |
getId() |
java.util.List<Marker> |
getMarkers()
Returns a list of all
Marker 's in this layer. |
boolean |
isVisible() |
void |
removeMarker(long markerId) |
void |
removeMarker(Marker marker)
Removes the given
Marker from this layer and the map. |
void |
removeMarkers(long[] markerIds) |
void |
setIcon(android.content.Context context,
android.graphics.drawable.Drawable drawable)
Assigns a Drawable as an icon to this
MarkerLayer . |
void |
setIconPath(java.lang.String iconPath)
Assigns an icon to this
MarkerLayer . |
void |
updateMarker(Marker marker)
Updates the given
Marker with the currently contained information. |
public long getId()
public java.lang.String getIconPath()
public void setIconPath(java.lang.String iconPath) throws java.io.FileNotFoundException
MarkerLayer
. It will be used for all Marker
's
created after this call.iconPath
- The full path to the icon image file on the device. May not be null.java.io.FileNotFoundException
- Thrown when the given image file cannot be found or read.public void setIcon(android.content.Context context, android.graphics.drawable.Drawable drawable) throws java.io.FileNotFoundException, MarkerOperationException
MarkerLayer
.context
- The Context for this Drawable.drawable
- The Drawable to use.java.io.FileNotFoundException
- When the given image file cannot be found or read.MarkerOperationException
- When the image file could not be cached.public boolean isVisible()
public Marker createMarkerAt(double latitude, double longitude) throws MarkerOperationException
Marker
at the given coordinates. It will be added to this layer and to
the map this layer belongs to.latitude
- The latitude degrees of the Marker
's position.longitude
- The longitude degrees of the Marker
's position.Marker
, or null when creation failed.MarkerOperationException
- When the Marker
's anchor point could not be set.public Marker createMarkerFrom(android.os.Parcel in) throws MarkerOperationException
Marker
using the given Parcel
. It will be added to this layer
and to the map this layer belongs to.in
- The Parcel
containing the instance state information.Marker
, or null when creation failed.MarkerOperationException
- When the new Marker
could not be added to this MarkerLayer
.public void updateMarker(Marker marker) throws MarkerOperationException
Marker
with the currently contained information.marker
- The Marker
to update.MarkerOperationException
- When the marker was not successfully updated.public void addMarker(Marker marker) throws MarkerOperationException
Marker
to this layer and the map. This marker will have a valid ID
after this call.marker
- The Marker
to add.MarkerOperationException
- When the marker was not successfully added.public void removeMarker(Marker marker)
Marker
from this layer and the map. This marker will become invalid
and may no longer be used!marker
- The Marker
to remove.public void removeMarker(long markerId)
public void removeMarkers(long[] markerIds)