
public class TilesOverlay extends Overlay implements IOverlayMenuProvider
TilesOverlay is responsible to display a MapTile.
These objects are the principle consumer of map tiles.
see MapTile for an overview of how tiles are acquired by this overlay.Overlay.Snappable| Modifier and Type | Field and Description |
|---|---|
static ColorFilter |
INVERT_COLORS
provides a night mode like affect by inverting the map tile colors
|
protected Paint |
mDebugPaint |
static int |
MENU_MAP_MODE |
static int |
MENU_OFFLINE |
static int |
MENU_TILE_SOURCE_STARTING_ID |
protected MapTileProviderBase |
mTileProvider
Current tile source
|
(package private) static float[] |
negate |
protected Drawable |
userSelectedLoadingDrawable |
SHADOW_X_SKEW, SHADOW_Y_SCALEDEFAULT_ZOOMLEVEL_MINIMAP_DIFFERENCE, NOT_SET| Constructor and Description |
|---|
TilesOverlay(MapTileProviderBase aTileProvider,
Context aContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
draw(Canvas c,
MapView osmv,
boolean shadow)
Draw the overlay over the map.
|
void |
drawTiles(Canvas c,
Projection projection,
int zoomLevel,
int tileSizePx,
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(Menu pMenu,
int pMenuIdOffset,
MapView pMapView) |
void |
onDetach(MapView pMapView)
Override to perform clean up of resources before shutdown.
|
boolean |
onOptionsItemSelected(MenuItem pItem,
int pMenuIdOffset,
MapView pMapView) |
boolean |
onPrepareOptionsMenu(Menu pMenu,
int pMenuIdOffset,
MapView pMapView) |
protected void |
onTileReadyToDraw(Canvas c,
Drawable currentMapTile,
Rect tileRect) |
void |
setColorFilter(ColorFilter filter)
sets the current color filter, which is applied to tiles before being drawn to the screen.
|
void |
setLoadingBackgroundColor(int pLoadingBackgroundColor)
Set the color to use to draw the background while we're waiting for the tile to load.
|
void |
setLoadingDrawable(Drawable drawable)
See issue https://github.com/osmdroid/osmdroid/issues/330
customizable override for the grey grid
|
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.
|
drawAt, getSafeMenuId, getSafeMenuIdSequence, isEnabled, onDoubleTap, onDoubleTapEvent, onDown, onFling, onKeyDown, onKeyUp, onLongPress, onScroll, onShowPress, onSingleTapConfirmed, onSingleTapUp, onTouchEvent, onTrackballEvent, setEnabledpublic 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 Drawable userSelectedLoadingDrawable
protected final Paint mDebugPaint
static final float[] negate
public static final ColorFilter INVERT_COLORS
public TilesOverlay(MapTileProviderBase aTileProvider, Context aContext)
public void setLoadingDrawable(Drawable drawable)
drawable - public void onDetach(MapView pMapView)
Overlaypublic 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.public void draw(Canvas c,
MapView osmv,
boolean shadow)
Overlaypublic void drawTiles(Canvas c,
Projection projection,
int zoomLevel,
int tileSizePx,
Rect viewPort)
protected void onTileReadyToDraw(Canvas c,
Drawable currentMapTile,
Rect tileRect)
public void setOptionsMenuEnabled(boolean pOptionsMenuEnabled)
setOptionsMenuEnabled in interface IOverlayMenuProviderpublic boolean isOptionsMenuEnabled()
IOverlayMenuProviderisOptionsMenuEnabled in interface IOverlayMenuProviderpublic boolean onCreateOptionsMenu(Menu pMenu,
int pMenuIdOffset,
MapView pMapView)
onCreateOptionsMenu in interface IOverlayMenuProviderpublic boolean onPrepareOptionsMenu(Menu pMenu,
int pMenuIdOffset,
MapView pMapView)
onPrepareOptionsMenu in interface IOverlayMenuProviderpublic boolean onOptionsItemSelected(MenuItem pItem,
int pMenuIdOffset,
MapView pMapView)
onOptionsItemSelected in interface IOverlayMenuProviderpublic 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()
public void setColorFilter(ColorFilter filter)
filter -