public abstract class MapItem extends FilterMetaDataHolder implements HashtagContent, VisibilityListener
MapItem has the following properties:
Notable UserControlComponent (touch) behavior:
Notable GLMapComponent (graphics) behavior:
| Modifier and Type | Class and Description |
|---|---|
static interface |
MapItem.OnAltitudeModeChangedListener
Altitude mode property listener
|
static interface |
MapItem.OnClickableChangedListener
Clickable property listener
|
static interface |
MapItem.OnGroupChangedListener |
static interface |
MapItem.OnHeightChangedListener
Height property listener
|
static interface |
MapItem.OnMetadataChangedListener |
static interface |
MapItem.OnTypeChangedListener
Type property listener
|
static interface |
MapItem.OnVisibleChangedListener
Visible property listener
|
static interface |
MapItem.OnZOrderChangedListener
ZOrder property listener
|
| Modifier and Type | Field and Description |
|---|---|
static boolean |
CLICKABLE_DEFAULT
Default value of the clickable property
|
static boolean |
EDITABLE_DEFAULT |
static java.lang.String |
EMPTY_TYPE
The CoT type designating an empty type within the system.
|
static double |
HIT_RATIO_DEFAULT
Default hit radius ratio (32dp)
|
static boolean |
MOVABLE_DEFAULT |
static boolean |
VISIBLE_DEFAULT
Default value of the visible property
|
static double |
ZORDER_DEFAULT
Default value of the zOrder property
|
static java.util.Comparator<MapItem> |
ZORDER_HITTEST_COMPARATOR
Orders by Z-order, ASCENDING.
|
static java.util.Comparator<MapItem> |
ZORDER_RENDER_COMPARATOR
Orders by Z-order, DESCENDING.
|
metadata| Modifier and Type | Method and Description |
|---|---|
void |
addOnAltitudeModeChangedListener(MapItem.OnAltitudeModeChangedListener listener)
Add altitude mode property listener
|
void |
addOnClickableChangedListener(MapItem.OnClickableChangedListener listener)
Add a clickable property listener
|
void |
addOnGroupChangedListener(MapItem.OnGroupChangedListener listener) |
void |
addOnHeightChangedListener(MapItem.OnHeightChangedListener listener)
Add a height changed property listener
|
void |
addOnMetadataChangedListener(MapItem.OnMetadataChangedListener listener)
Deprecated.
|
void |
addOnMetadataChangedListener(java.lang.String key,
MapItem.OnMetadataChangedListener l)
Add a metadata changed property listener for a specific key
|
void |
addOnTypeChangedListener(MapItem.OnTypeChangedListener listener)
Add a type property listener
|
void |
addOnVisibleChangedListener(MapItem.OnVisibleChangedListener listener)
Add a visible property listener
|
void |
addOnZOrderChangedListener(MapItem.OnZOrderChangedListener listener)
Add a zOrder property listener
|
static double |
computeDistance(MapItem item,
GeoPoint point) |
void |
copyMetaData(java.util.Map<java.lang.String,java.lang.Object> bundle)
Copies the metadata in the specified bundle into this metadata.
|
static long |
createSerialId() |
void |
dispose()
Clean up all of the resources associated with this MapItem, for destruction.
|
AltitudeMode |
getAltitudeMode()
Gets the current Altitude Mode for the polyline.
|
boolean |
getClickable()
Get the clickable property value.
|
GeoPoint |
getClickPoint()
Look for the last touched point on this item
|
boolean |
getEditable() |
MapGroup |
getGroup()
Get the parent map group to which this item belongs to
Note: This method is intentionally non-synchronized due to noted
performance issues
|
HashtagSet |
getHashtags()
Get tags associated with this content
|
double |
getHeight()
Get the height property value or Double.NaN is to known.
|
float |
getHitRadius(MapView view)
Get the hit/touch radius for this map item
|
int |
getIconColor()
Get the color of the icon
|
android.graphics.drawable.Drawable |
getIconDrawable()
Icon for this content
|
boolean |
getMetaBoolean(java.lang.String k,
boolean dv)
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given key.
|
java.lang.String |
getMetaString(java.lang.String k,
java.lang.String dv)
uid and type are very popular calls.
|
boolean |
getMovable() |
java.lang.String |
getRadialMenuPath()
Get the path to the radial menu for this map item
|
java.lang.String |
getRemarks() |
protected java.lang.String |
getRemarksKey()
Get the metadata key for where remarks are stored
99.9% of the time this is just "remarks".
|
long |
getSerialId() |
java.lang.Object |
getTag()
Get the client-specific object used to distinguish this MapItem from others.
|
java.lang.String |
getTitle()
Get the title of this map item (display name)
|
java.lang.String |
getType()
Get the type of the Marker.
|
java.lang.String |
getUID()
Returns the permanent uid for this MapItem.
|
static java.lang.String |
getUniqueMapItemName(MapItem mapItem) |
java.lang.String |
getURI()
Get a URI that represents this content
|
boolean |
getVisible() |
boolean |
getVisible(boolean ignoreConditions)
Get the visible property value.
|
double |
getZOrder()
Get the item zOrder.
|
boolean |
isTouchable()
Deprecated.
|
void |
notifyMetadataChanged(java.lang.String key)
Deprecated.
No longer necessary when
addOnMetadataChangedListener(String, OnMetadataChangedListener)
is used instead |
void |
onAdded(MapGroup parent) |
protected void |
onAltitudeModeChanged()
Invoked when the altitude mode property changes
|
protected void |
onClickableChanged()
Invokes when the clickable property changes
|
protected void |
onGroupChanged(boolean added,
MapGroup mapGroup) |
protected void |
onHeightChanged()
Invoked when the height property changes
|
protected void |
onMetadataChanged(java.lang.String key)
Invoked when the metadata property changes
|
void |
onRemoved(MapGroup parent) |
protected void |
onTypeChanged()
Invokes when the type property changes
|
void |
onVisibilityConditions(java.util.List<VisibilityCondition> conditions)
Visibility conditions have changed or should be processed
This is where implementations should go through their contents and apply
visibility based on these conditions
|
protected void |
onVisibleChanged()
Invokes when the visible property changes
|
protected void |
onZOrderChanged()
Invokes when the zOrder property changes
|
void |
persist(MapEventDispatcher dispatcher,
android.os.Bundle persistExtras,
java.lang.Class<?> clazz)
Dispatches a persist event for the MapItem.
|
void |
refresh(MapEventDispatcher dispatcher,
android.os.Bundle refreshExtras,
java.lang.Class<?> clazz)
Dispatches a refresh event for the MapItem.
|
boolean |
removeFromGroup()
Helper method for removing an item from its map group
In most circumstances, this will remove the item from the map
|
void |
removeMetaData(java.lang.String k)
Removes the metadata associated with the specified key.
|
void |
removeOnAltitudeModeChangedListener(MapItem.OnAltitudeModeChangedListener listener) |
void |
removeOnClickableChangedListener(MapItem.OnClickableChangedListener listener)
Remove a clickable property listener
|
void |
removeOnGroupChangedListener(MapItem.OnGroupChangedListener listener) |
void |
removeOnHeightChangedListener(MapItem.OnHeightChangedListener listener)
Remove a height changed property listener
|
void |
removeOnMetadataChangedListener(MapItem.OnMetadataChangedListener listener)
Deprecated.
|
void |
removeOnMetadataChangedListener(java.lang.String key,
MapItem.OnMetadataChangedListener l)
Add a metadata changed property listener for a specific key
|
void |
removeOnTypeChangedListener(MapItem.OnTypeChangedListener listener)
Remove a visible property listener
|
void |
removeOnVisibleChangedListener(MapItem.OnVisibleChangedListener listener)
Remove a visible property listener
|
void |
removeOnZOrderChangedListener(MapItem.OnZOrderChangedListener listener)
Remove a zOrder property listener
|
void |
setAltitudeMode(AltitudeMode altitudeMode)
Set the altitude mode for this item
See
AltitudeMode for possible values |
void |
setClickable(boolean clickable)
Set the clickable property value.
|
void |
setClickPoint(GeoPoint gp)
Set the geo point at which this item was last touched
|
void |
setEditable(boolean editable) |
void |
setHashtags(java.util.Collection<java.lang.String> tags)
Set tags associated with this content
|
void |
setHeight(double height)
Set the height of this item
|
void |
setMetaBoolean(java.lang.String key,
boolean value)
Inserts a Boolean value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaData(java.util.Map<java.lang.String,java.lang.Object> bundle)
Sets this metadata to the metadata in the specified bundle.
|
void |
setMetaDouble(java.lang.String key,
double value)
Inserts a double value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaIntArray(java.lang.String key,
int[] value)
Inserts an int array value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaInteger(java.lang.String key,
int value)
Inserts an int value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaLong(java.lang.String key,
long value)
Inserts a long value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaMap(java.lang.String key,
java.util.Map<java.lang.String,java.lang.Object> bundle)
Sets the bundle associated with the specified key.
|
void |
setMetaParcelable(java.lang.String key,
android.os.Parcelable value)
Inserts a Parcelable value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaSerializable(java.lang.String key,
java.io.Serializable value)
Inserts a Serializable value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaString(java.lang.String key,
java.lang.String value)
Inserts a String value into the mapping of this Bundle, replacing
any existing value for the given key.
|
void |
setMetaStringArrayList(java.lang.String key,
java.util.ArrayList<java.lang.String> value)
Inserts an ArrayList
|
void |
setMovable(boolean movable) |
void |
setRadialMenu(java.lang.String menuPath)
Set the path to the radial menu for this map item
|
void |
setRemarks(java.lang.String remarks)
Set map item remarks (may contain hashtags)
|
void |
setTag(java.lang.Object tag)
Set a client-specific object used distinguish this MapItem from others.
|
void |
setTitle(java.lang.String title)
Set the title of this map item (display name)
|
void |
setTouchable(boolean state)
Deprecated.
|
void |
setType(java.lang.String type)
Set the type of the Marker.
|
void |
setVisible(boolean visible) |
void |
setVisible(boolean visible,
boolean ignoreConditions)
Set visible property value.
|
void |
setZOrder(double zOrder)
Set the ascending order of the MapItem.
|
boolean |
testOrthoHit(int xpos,
int ypos,
GeoPoint point,
MapView view)
Deprecated.
Hit-testing is now handled by implementing
HitTestable#hitTest(MapRenderer3, HitTestQueryParameters)
in the GL counterpart for this map item. |
java.lang.String |
toString()
Default string conversion which contains the UID, type, and title
|
get, getMetaData, getMetaDouble, getMetaIntArray, getMetaInteger, getMetaLong, getMetaMap, getMetaParcelable, getMetaSerializable, getMetaStringArrayList, hasMetaValue, setMetaDataImpl, toggleMetaDatapublic static final java.util.Comparator<MapItem> ZORDER_RENDER_COMPARATOR
public static final java.util.Comparator<MapItem> ZORDER_HITTEST_COMPARATOR
public static final boolean VISIBLE_DEFAULT
public static final boolean CLICKABLE_DEFAULT
public static final boolean EDITABLE_DEFAULT
public static final boolean MOVABLE_DEFAULT
public static final double ZORDER_DEFAULT
public static final java.lang.String EMPTY_TYPE
public static final double HIT_RATIO_DEFAULT
public final java.lang.String getUID()
public final void setType(java.lang.String type)
public final java.lang.String getType()
public java.lang.String getTitle()
getTitle in interface URIContentpublic void setTitle(java.lang.String title)
title - Item titlepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getMetaString(java.lang.String k,
java.lang.String dv)
getMetaString in interface MetaDataHoldergetMetaString in class FilterMetaDataHolderk - a String, or nulldv - Value to return if key does not exist or if a null
value is associated with the given key.public boolean getMetaBoolean(java.lang.String k,
boolean dv)
MetaDataHoldergetMetaBoolean in interface MetaDataHoldergetMetaBoolean in class FilterMetaDataHolderk - a Stringdv - Value to return if key does not existpublic void addOnClickableChangedListener(MapItem.OnClickableChangedListener listener)
listener - the listener to addpublic void addOnVisibleChangedListener(MapItem.OnVisibleChangedListener listener)
listener - the listener to addpublic void addOnTypeChangedListener(MapItem.OnTypeChangedListener listener)
listener - the listener to addpublic void removeOnClickableChangedListener(MapItem.OnClickableChangedListener listener)
listener - the listener to addpublic void removeOnVisibleChangedListener(MapItem.OnVisibleChangedListener listener)
listener - the listener to removepublic void removeOnTypeChangedListener(MapItem.OnTypeChangedListener listener)
listener - the listener to removepublic void addOnZOrderChangedListener(MapItem.OnZOrderChangedListener listener)
listener - the listener to addpublic void removeOnZOrderChangedListener(MapItem.OnZOrderChangedListener listener)
listener - the listener to addpublic void addOnMetadataChangedListener(java.lang.String key,
MapItem.OnMetadataChangedListener l)
key - Key to listen for changes onl - Listenerpublic void removeOnMetadataChangedListener(java.lang.String key,
MapItem.OnMetadataChangedListener l)
key - Key to remove listener froml - Listener@Deprecated public void addOnMetadataChangedListener(MapItem.OnMetadataChangedListener listener)
addOnMetadataChangedListener(String, OnMetadataChangedListener) insteadlistener - the listener@Deprecated public void removeOnMetadataChangedListener(MapItem.OnMetadataChangedListener listener)
removeOnMetadataChangedListener(String, OnMetadataChangedListener) insteadlistener - the listenerpublic void setClickable(boolean clickable)
clickable - public boolean getClickable()
public void setVisible(boolean visible,
boolean ignoreConditions)
visible - the visible valueignoreConditions - True to set the visibility condition to ignore if
it conflicts with the new visibility statepublic void setVisible(boolean visible)
public boolean getVisible(boolean ignoreConditions)
ignoreConditions - True to ignore the visibility condition statepublic boolean getVisible()
public void setZOrder(double zOrder)
zOrder - public double getZOrder()
public void setEditable(boolean editable)
public boolean getEditable()
public void setMovable(boolean movable)
public boolean getMovable()
@Deprecated
public boolean testOrthoHit(int xpos,
int ypos,
GeoPoint point,
MapView view)
HitTestable#hitTest(MapRenderer3, HitTestQueryParameters)
in the GL counterpart for this map item.xpos - pixel x location (increases left -> right)ypos - pixel y location (increases top -> bottom)point - the pixel location as projected onto the map surface (lat, lng of pixel
location)view - the map view@Deprecated public void setTouchable(boolean state)
setClickable(boolean)@Deprecated public boolean isTouchable()
getClickable()public void setClickPoint(GeoPoint gp)
gp - Geo pointpublic GeoPoint getClickPoint()
public void setRadialMenu(java.lang.String menuPath)
menuPath - Menu pathpublic java.lang.String getRadialMenuPath()
public float getHitRadius(MapView view)
view - Map viewpublic void setTag(java.lang.Object tag)
tag - client-specific unique tagpublic java.lang.Object getTag()
public MapGroup getGroup()
public boolean removeFromGroup()
protected void onClickableChanged()
protected void onVisibleChanged()
protected void onTypeChanged()
protected void onZOrderChanged()
protected void onHeightChanged()
protected void onAltitudeModeChanged()
protected void onMetadataChanged(java.lang.String key)
key - Metadata key that has been changed@Deprecated public void notifyMetadataChanged(java.lang.String key)
addOnMetadataChangedListener(String, OnMetadataChangedListener)
is used insteadkey - Metadata key that has been changedpublic void dispose()
public void onAdded(MapGroup parent)
public void onRemoved(MapGroup parent)
public void addOnGroupChangedListener(MapItem.OnGroupChangedListener listener)
public void removeOnGroupChangedListener(MapItem.OnGroupChangedListener listener)
protected void onGroupChanged(boolean added,
MapGroup mapGroup)
public void addOnHeightChangedListener(MapItem.OnHeightChangedListener listener)
listener - the listenerpublic void removeOnHeightChangedListener(MapItem.OnHeightChangedListener listener)
listener - the listenerpublic void addOnAltitudeModeChangedListener(MapItem.OnAltitudeModeChangedListener listener)
listener - Listenerpublic void removeOnAltitudeModeChangedListener(MapItem.OnAltitudeModeChangedListener listener)
public long getSerialId()
public void persist(MapEventDispatcher dispatcher, android.os.Bundle persistExtras, java.lang.Class<?> clazz)
By default, the event will be dispatched with the extra, "internal", set to
true. This may be overridden by setting the parameter in
persistExtras to an alternate value.
dispatcher - The event dispatcherpersistExtras - An optional bundle of extras to be sent with the event; may be
nullclazz - the class that made this persist call
See MapEvent.ITEM_PERSISTpublic void refresh(MapEventDispatcher dispatcher, android.os.Bundle refreshExtras, java.lang.Class<?> clazz)
dispatcher - The event dispatcherrefreshExtras - An optional bundle of extras to be sent with the event; may be
null
See MapEvent.ITEM_REFRESHpublic static long createSerialId()
public static java.lang.String getUniqueMapItemName(MapItem mapItem)
public static double computeDistance(MapItem item, GeoPoint point)
public void copyMetaData(java.util.Map<java.lang.String,java.lang.Object> bundle)
MetaDataHoldercopyMetaData in interface MetaDataHoldercopyMetaData in class FilterMetaDataHolderprotected java.lang.String getRemarksKey()
public void setRemarks(java.lang.String remarks)
remarks - Remarks stringpublic java.lang.String getRemarks()
public void setHashtags(java.util.Collection<java.lang.String> tags)
HashtagContentsetHashtags in interface HashtagContenttags - List of tags or null to removepublic HashtagSet getHashtags()
HashtagContentgetHashtags in interface HashtagContentpublic java.lang.String getURI()
URIContentgetURI in interface URIContentpublic android.graphics.drawable.Drawable getIconDrawable()
URIContentgetIconDrawable in interface URIContentpublic int getIconColor()
URIContentgetIconColor in interface URIContentpublic void setHeight(double height)
height - the height in meters or Double.NaN if unknown.public double getHeight()
public void setAltitudeMode(AltitudeMode altitudeMode)
AltitudeMode for possible valuesaltitudeMode - Altitude modepublic AltitudeMode getAltitudeMode()
public void onVisibilityConditions(java.util.List<VisibilityCondition> conditions)
VisibilityListeneronVisibilityConditions in interface VisibilityListenerconditions - List of visibility conditionspublic void setMetaInteger(java.lang.String key,
int value)
MetaDataHoldersetMetaInteger in interface MetaDataHoldersetMetaInteger in class FilterMetaDataHolderkey - a String, or nullvalue - an intpublic void setMetaDouble(java.lang.String key,
double value)
MetaDataHoldersetMetaDouble in interface MetaDataHoldersetMetaDouble in class FilterMetaDataHolderkey - a String, or nullvalue - a doublepublic void setMetaString(java.lang.String key,
java.lang.String value)
MetaDataHoldersetMetaString in interface MetaDataHoldersetMetaString in class FilterMetaDataHolderkey - a String, or nullvalue - a String, or nullpublic void setMetaBoolean(java.lang.String key,
boolean value)
MetaDataHoldersetMetaBoolean in interface MetaDataHoldersetMetaBoolean in class FilterMetaDataHolderkey - a String, or nullvalue - a booleanpublic void removeMetaData(java.lang.String k)
MetaDataHolderremoveMetaData in interface MetaDataHolderremoveMetaData in class FilterMetaDataHolderpublic void setMetaData(java.util.Map<java.lang.String,java.lang.Object> bundle)
MetaDataHoldersetMetaData in interface MetaDataHoldersetMetaData in class FilterMetaDataHolderpublic void setMetaLong(java.lang.String key,
long value)
MetaDataHoldersetMetaLong in interface MetaDataHoldersetMetaLong in class FilterMetaDataHolderkey - a String, or nullvalue - a longpublic void setMetaMap(java.lang.String key,
java.util.Map<java.lang.String,java.lang.Object> bundle)
MetaDataHolderbundle after the method returns will not be
reflected in the underlying metadata.setMetaMap in interface MetaDataHoldersetMetaMap in class FilterMetaDataHolderpublic void setMetaStringArrayList(java.lang.String key,
java.util.ArrayList<java.lang.String> value)
MetaDataHoldersetMetaStringArrayList in interface MetaDataHoldersetMetaStringArrayList in class FilterMetaDataHolderkey - a String, or nullvalue - an ArrayListpublic void setMetaIntArray(java.lang.String key,
int[] value)
MetaDataHoldersetMetaIntArray in interface MetaDataHoldersetMetaIntArray in class FilterMetaDataHolderkey - a String, or nullvalue - an int array object, or nullpublic void setMetaSerializable(java.lang.String key,
java.io.Serializable value)
MetaDataHoldersetMetaSerializable in interface MetaDataHoldersetMetaSerializable in class FilterMetaDataHolderkey - a String, or nullvalue - a Serializable object, or nullpublic void setMetaParcelable(java.lang.String key,
android.os.Parcelable value)
MetaDataHoldersetMetaParcelable in interface MetaDataHoldersetMetaParcelable in class FilterMetaDataHolderkey - a String, or nullvalue - a Parcelable object, or null