public class Marker
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<Marker> |
CREATOR
Creates a new
Marker from the given Parcel . |
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
long |
getId() |
android.location.Location |
getLocation() |
java.lang.Object |
getTag() |
void |
setAnchorPoint(int x,
int y)
The anchor point defines which point of the icon is used as the reference for associating the
icon to the map coordinates.
|
void |
setIcon(android.content.Context context,
android.graphics.drawable.Drawable drawable)
Replaces the icon of this
Marker by the given Drawable . |
void |
setIcon(java.lang.String iconPath)
Sets the icon for this
Marker . |
void |
setLocation(android.location.Location location)
Set location for the marker.
|
void |
setTag(java.lang.Object tag)
Sets the given
Object as a tag to this Marker . |
java.lang.String |
toString()
This class converted to a JSON string.
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
public int describeContents()
describeContents
in interface android.os.Parcelable
public void setIcon(java.lang.String iconPath) throws java.io.FileNotFoundException, MarkerOperationException
Marker
. The file should be present on the device and
accessible.iconPath
- The path to the icon file.java.io.FileNotFoundException
- When the file does not exist or cannot be read.MarkerOperationException
- When the Marker
could not be updated with the new icon.public void setIcon(android.content.Context context, android.graphics.drawable.Drawable drawable) throws java.io.FileNotFoundException, MarkerOperationException
Marker
by the given Drawable
.context
- This Context
is used to determine the cache directory.drawable
- The Drawable
to use as an icon. May not be null.java.io.FileNotFoundException
- When the icon cannot be found or is null.MarkerOperationException
- When the Marker
could not be updated with the new icon.public void setAnchorPoint(int x, int y) throws MarkerOperationException
x
- The horizontal position.y
- The vertical postition.MarkerOperationException
- When the anchor point could not be succesfully set.public android.location.Location getLocation()
Location
of this Marker
.public void setLocation(android.location.Location location)
location
- new location.public java.lang.Object getTag()
Marker
.public void setTag(java.lang.Object tag)
Object
as a tag to this Marker
.tag
- The object to use as a tag.public long getId()
Marker
as used by the map.public java.lang.String toString()
toString
in class java.lang.Object