
public class MapTileProviderArray extends MapTileProviderBase implements MapTileContainer
MapTileProviderArray first checks the MapTileCache (synchronously) and returns
the tile if available. If not, then the MapTileProviderArray returns null and sends the
tile request through the asynchronous tile request chain. Each asynchronous tile provider returns
success/failure to the MapTileProviderArray. If successful, the
MapTileProviderArray passes the result to the base class. If failed, then the next
asynchronous tile provider is called in the chain. If there are no more asynchronous tile
providers in the chain, then the failure result is passed to the base class. The
MapTileProviderArray provides a mechanism so that only one unique tile-request can be in
the map tile request chain at a time.| Modifier and Type | Field and Description |
|---|---|
protected List<MapTileModuleProviderBase> |
mTileProviderList |
MAPTILE_FAIL_ID, MAPTILE_SUCCESS_ID, mTileCache, mTileNotFoundImage, mUseDataConnection| Modifier | Constructor and Description |
|---|---|
protected |
MapTileProviderArray(ITileSource pTileSource,
IRegisterReceiver pRegisterReceiver)
Creates an
MapTileProviderArray with no tile providers. |
|
MapTileProviderArray(ITileSource pTileSource,
IRegisterReceiver aRegisterReceiver,
MapTileModuleProviderBase[] pTileProviderArray)
Creates an
MapTileProviderArray with the specified tile providers. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(long pTileIndex) |
void |
detach()
classes that extend MapTileProviderBase must call this method to prevent memory leaks.
|
protected MapTileModuleProviderBase |
findNextAppropriateProvider(MapTileRequestState aState)
We want to not use a provider that doesn't exist anymore in the chain, and we want to not use
a provider that requires a data connection when one is not available.
|
Drawable |
getMapTile(long pMapTileIndex)
Attempts to get a Drawable that represents a
MapTileIndex. |
int |
getMaximumZoomLevel()
Gets the maximum zoom level this tile provider can provide
|
int |
getMinimumZoomLevel()
Gets the minimum zoom level this tile provider can provide
|
boolean |
getProviderExists(MapTileModuleProviderBase provider) |
long |
getQueueSize() |
IFilesystemCache |
getTileWriter() |
protected boolean |
isDowngradedMode()
Deprecated.
Not used anymore. Use
isDowngradedMode(long) instead |
protected boolean |
isDowngradedMode(long pMapTileIndex) |
void |
mapTileRequestCompleted(MapTileRequestState aState,
Drawable aDrawable)
Called by implementation class methods indicating that they have completed the request as
best it can.
|
void |
mapTileRequestExpiredTile(MapTileRequestState aState,
Drawable aDrawable)
Called by implementation class methods indicating that they have produced an expired result
that can be used but better results may be delivered later.
|
void |
mapTileRequestFailed(MapTileRequestState aState)
Called by implementation class methods indicating that they have failed to retrieve the
requested map tile.
|
void |
mapTileRequestFailedExceedsMaxQueueSize(MapTileRequestState aState)
Called by implementation class methods indicating that they have failed to retrieve the
requested map tile, because the max queue size has been reached
|
void |
setTileSource(ITileSource aTileSource)
Sets the tile source for this tile provider.
|
clearTileCache, createTileCache, ensureCapacity, expireInMemoryCache, getTileCache, getTileRequestCompleteHandlers, getTileSource, putExpiredTileIntoCache, putTileIntoCache, rescaleCache, setTileLoadFailureImage, setTileRequestCompleteHandler, setUseDataConnection, useDataConnectionprotected final List<MapTileModuleProviderBase> mTileProviderList
protected MapTileProviderArray(ITileSource pTileSource, IRegisterReceiver pRegisterReceiver)
MapTileProviderArray with no tile providers.pRegisterReceiver - a IRegisterReceiverpublic MapTileProviderArray(ITileSource pTileSource, IRegisterReceiver aRegisterReceiver, MapTileModuleProviderBase[] pTileProviderArray)
MapTileProviderArray with the specified tile providers.aRegisterReceiver - a IRegisterReceiverpTileProviderArray - an array of MapTileModuleProviderBasepublic void detach()
MapTileProviderBasedetach in class MapTileProviderBasepublic boolean contains(long pTileIndex)
contains in interface MapTileContainer@Deprecated protected boolean isDowngradedMode()
isDowngradedMode(long) insteadprotected boolean isDowngradedMode(long pMapTileIndex)
public Drawable getMapTile(long pMapTileIndex)
MapTileProviderBaseMapTileIndex. If the tile is not immediately
available this will return null and attempt to get the tile from known tile sources for
subsequent future requests. Note that this may return a ReusableBitmapDrawable in
which case you should follow proper handling procedures for using that Drawable or it may
reused while you are working with it.getMapTile in class MapTileProviderBaseReusableBitmapDrawablepublic void mapTileRequestCompleted(MapTileRequestState aState, Drawable aDrawable)
MapTileProviderBasemapTileRequestCompleted in interface IMapTileProviderCallbackmapTileRequestCompleted in class MapTileProviderBaseaState - the map tile request state objectaDrawable - the Drawable of the map tilepublic void mapTileRequestFailed(MapTileRequestState aState)
MapTileProviderBasemapTileRequestFailed in interface IMapTileProviderCallbackmapTileRequestFailed in class MapTileProviderBaseaState - the map tile request state objectpublic void mapTileRequestFailedExceedsMaxQueueSize(MapTileRequestState aState)
MapTileProviderBasemapTileRequestFailedExceedsMaxQueueSize in interface IMapTileProviderCallbackmapTileRequestFailedExceedsMaxQueueSize in class MapTileProviderBaseaState - the map tile request state objectpublic void mapTileRequestExpiredTile(MapTileRequestState aState, Drawable aDrawable)
MapTileProviderBasemapTileRequestExpiredTile in interface IMapTileProviderCallbackmapTileRequestExpiredTile in class MapTileProviderBaseaState - the map tile request state objectaDrawable - the Drawable of the map tilepublic IFilesystemCache getTileWriter()
getTileWriter in class MapTileProviderBasepublic long getQueueSize()
getQueueSize in class MapTileProviderBaseprotected MapTileModuleProviderBase findNextAppropriateProvider(MapTileRequestState aState)
public boolean getProviderExists(MapTileModuleProviderBase provider)
public int getMinimumZoomLevel()
MapTileProviderBasegetMinimumZoomLevel in class MapTileProviderBasepublic int getMaximumZoomLevel()
MapTileProviderBasegetMaximumZoomLevel in class MapTileProviderBasepublic void setTileSource(ITileSource aTileSource)
MapTileProviderBasesetTileSource in class MapTileProviderBaseaTileSource - the tile source