public class TilesOverlay extends SafeDrawOverlay implements IOverlayMenuProvider
MapTile
for an overview of how tiles are acquired by this overlay.Overlay.Snappable
Modifier and Type | Field and Description |
---|---|
protected android.graphics.Paint |
mDebugPaint |
static int |
MENU_MAP_MODE |
static int |
MENU_OFFLINE |
static int |
MENU_TILE_SOURCE_STARTING_ID |
protected MapTileProviderBase |
mTileProvider
Current tile source
|
mResourceProxy, mScale, SHADOW_X_SKEW, SHADOW_Y_SCALE
DEBUGMODE, DEFAULT_ZOOMLEVEL_MINIMAP_DIFFERENCE, NOT_SET
Constructor and Description |
---|
TilesOverlay(MapTileProviderBase aTileProvider,
android.content.Context aContext) |
TilesOverlay(MapTileProviderBase aTileProvider,
ResourceProxy pResourceProxy) |
Modifier and Type | Method and Description |
---|---|
protected void |
drawSafe(ISafeCanvas c,
MapView osmv,
boolean shadow) |
void |
drawTiles(android.graphics.Canvas c,
int zoomLevel,
int tileSizePx,
android.graphics.Rect viewPort)
This is meant to be a "pure" tile drawing function that doesn't take into account
osmdroid-specific characteristics (like osmdroid's canvas's having 0,0 as the center rather
than the upper-left corner).
|
int |
getLoadingBackgroundColor() |
int |
getLoadingLineColor() |
int |
getMaximumZoomLevel() |
int |
getMinimumZoomLevel() |
int |
getOvershootTileCache()
Get the tile cache overshoot value.
|
boolean |
isOptionsMenuEnabled()
Can be used to signal to external callers that this Overlay should not be used for providing
option menu items.
|
boolean |
onCreateOptionsMenu(android.view.Menu pMenu,
int pMenuIdOffset,
MapView pMapView) |
void |
onDetach(MapView pMapView)
Override to perform clean up of resources before shutdown.
|
boolean |
onOptionsItemSelected(android.view.MenuItem pItem,
int pMenuIdOffset,
MapView pMapView) |
boolean |
onPrepareOptionsMenu(android.view.Menu pMenu,
int pMenuIdOffset,
MapView pMapView) |
protected void |
onTileReadyToDraw(android.graphics.Canvas c,
android.graphics.drawable.Drawable currentMapTile,
android.graphics.Rect tileRect) |
void |
setLoadingBackgroundColor(int pLoadingBackgroundColor)
Set the color to use to draw the background while we're waiting for the tile to load.
|
void |
setLoadingLineColor(int pLoadingLineColor) |
void |
setOptionsMenuEnabled(boolean pOptionsMenuEnabled) |
void |
setOvershootTileCache(int overshootTileCache)
Set this to overshoot the tile cache.
|
void |
setUseDataConnection(boolean aMode)
Set whether to use the network connection if it's available.
|
boolean |
useDataConnection()
Whether to use the network connection if it's available.
|
draw, isUsingSafeCanvas, setUseSafeCanvas
drawAt, getSafeMenuId, getSafeMenuIdSequence, isEnabled, onDoubleTap, onDoubleTapEvent, onDown, onFling, onKeyDown, onKeyUp, onLongPress, onScroll, onShowPress, onSingleTapConfirmed, onSingleTapUp, onTouchEvent, onTrackballEvent, setEnabled
public static final int MENU_MAP_MODE
public static final int MENU_TILE_SOURCE_STARTING_ID
public static final int MENU_OFFLINE
protected final MapTileProviderBase mTileProvider
protected final android.graphics.Paint mDebugPaint
public TilesOverlay(MapTileProviderBase aTileProvider, android.content.Context aContext)
public TilesOverlay(MapTileProviderBase aTileProvider, ResourceProxy pResourceProxy)
public void onDetach(MapView pMapView)
Overlay
public int getMinimumZoomLevel()
public int getMaximumZoomLevel()
public boolean useDataConnection()
public void setUseDataConnection(boolean aMode)
aMode
- if true use the network connection if it's available. if false don't use the
network connection even if it's available.protected void drawSafe(ISafeCanvas c, MapView osmv, boolean shadow)
drawSafe
in class SafeDrawOverlay
public void drawTiles(android.graphics.Canvas c, int zoomLevel, int tileSizePx, android.graphics.Rect viewPort)
protected void onTileReadyToDraw(android.graphics.Canvas c, android.graphics.drawable.Drawable currentMapTile, android.graphics.Rect tileRect)
public void setOptionsMenuEnabled(boolean pOptionsMenuEnabled)
setOptionsMenuEnabled
in interface IOverlayMenuProvider
public boolean isOptionsMenuEnabled()
IOverlayMenuProvider
isOptionsMenuEnabled
in interface IOverlayMenuProvider
public boolean onCreateOptionsMenu(android.view.Menu pMenu, int pMenuIdOffset, MapView pMapView)
onCreateOptionsMenu
in interface IOverlayMenuProvider
public boolean onPrepareOptionsMenu(android.view.Menu pMenu, int pMenuIdOffset, MapView pMapView)
onPrepareOptionsMenu
in interface IOverlayMenuProvider
public boolean onOptionsItemSelected(android.view.MenuItem pItem, int pMenuIdOffset, MapView pMapView)
onOptionsItemSelected
in interface IOverlayMenuProvider
public int getLoadingBackgroundColor()
public void setLoadingBackgroundColor(int pLoadingBackgroundColor)
pLoadingBackgroundColor
- the color to use. If the value is Color.TRANSPARENT
then there will be no
loading tile.public int getLoadingLineColor()
public void setLoadingLineColor(int pLoadingLineColor)
public void setOvershootTileCache(int overshootTileCache)
overshootTileCache
- the number of tiles to overshoot the tile cache bypublic int getOvershootTileCache()
Copyright © 2014. All Rights Reserved.