org.osmdroid.views.overlay
Class ItemizedIconOverlay<Item extends OverlayItem>
java.lang.Object
org.osmdroid.views.overlay.Overlay
org.osmdroid.views.overlay.ItemizedOverlay<Item>
org.osmdroid.views.overlay.ItemizedIconOverlay<Item>
- All Implemented Interfaces:
- Overlay.Snappable, OverlayConstants
- Direct Known Subclasses:
- ItemizedOverlayWithFocus
public class ItemizedIconOverlay<Item extends OverlayItem>
- extends ItemizedOverlay<Item>
Methods inherited from class org.osmdroid.views.overlay.Overlay |
drawAt, getSafeMenuId, getSafeMenuIdSequence, isEnabled, onDetach, onDoubleTap, onDoubleTapEvent, onDown, onFling, onKeyDown, onKeyUp, onScroll, onShowPress, onSingleTapConfirmed, onTouchEvent, onTrackballEvent, setEnabled |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mItemList
protected final List<Item extends OverlayItem> mItemList
mOnItemGestureListener
protected ItemizedIconOverlay.OnItemGestureListener<Item extends OverlayItem> mOnItemGestureListener
ItemizedIconOverlay
public ItemizedIconOverlay(List<Item> pList,
android.graphics.drawable.Drawable pDefaultMarker,
ItemizedIconOverlay.OnItemGestureListener<Item> pOnItemGestureListener,
ResourceProxy pResourceProxy)
ItemizedIconOverlay
public ItemizedIconOverlay(List<Item> pList,
ItemizedIconOverlay.OnItemGestureListener<Item> pOnItemGestureListener,
ResourceProxy pResourceProxy)
ItemizedIconOverlay
public ItemizedIconOverlay(android.content.Context pContext,
List<Item> pList,
ItemizedIconOverlay.OnItemGestureListener<Item> pOnItemGestureListener)
onSnapToItem
public boolean onSnapToItem(int pX,
int pY,
android.graphics.Point pSnapPoint,
IMapView pMapView)
- Description copied from interface:
Overlay.Snappable
- Checks to see if the given x and y are close enough to an item resulting in snapping the
current action (e.g. zoom) to the item.
- Parameters:
pX
- The x in screen coordinates.pY
- The y in screen coordinates.pSnapPoint
- To be filled with the the interesting point (in screen coordinates) that is
closest to the given x and y. Can be untouched if not snapping.pMapView
- The MapView
that is requesting the snap. Use MapView.getProjection()
to convert between on-screen pixels and latitude/longitude pairs.
- Returns:
- Whether or not to snap to the interesting point.
createItem
protected Item createItem(int index)
- Description copied from class:
ItemizedOverlay
- Method by which subclasses create the actual Items. This will only be called from populate()
we'll cache them for later use.
- Specified by:
createItem
in class ItemizedOverlay<Item extends OverlayItem>
size
public int size()
- Description copied from class:
ItemizedOverlay
- The number of items in this overlay.
- Specified by:
size
in class ItemizedOverlay<Item extends OverlayItem>
addItem
public boolean addItem(Item item)
addItem
public void addItem(int location,
Item item)
addItems
public boolean addItems(List<Item> items)
removeAllItems
public void removeAllItems()
removeAllItems
public void removeAllItems(boolean withPopulate)
removeItem
public boolean removeItem(Item item)
removeItem
public Item removeItem(int position)
onSingleTapUp
public boolean onSingleTapUp(android.view.MotionEvent event,
MapView mapView)
- Each of these methods performs a item sensitive check. If the item is located its
corresponding method is called. The result of the call is returned.
Helper methods are provided so that child classes may more easily override behavior without
resorting to overriding the ItemGestureListener methods.
- Overrides:
onSingleTapUp
in class Overlay
onSingleTapUpHelper
protected boolean onSingleTapUpHelper(int index,
Item item,
MapView mapView)
onLongPress
public boolean onLongPress(android.view.MotionEvent event,
MapView mapView)
- Description copied from class:
Overlay
- By default does nothing (
return false
). If you handled the Event, return
true
, otherwise return false
. If you returned true
none of the following Overlays or the underlying MapView
has the chance to handle
this event.
- Overrides:
onLongPress
in class Overlay
onLongPressHelper
protected boolean onLongPressHelper(int index,
Item item)
getDrawnItemsLimit
public int getDrawnItemsLimit()
setDrawnItemsLimit
public void setDrawnItemsLimit(int aLimit)
Copyright © 2012. All Rights Reserved.