Class TileMBTilesLayer
java.lang.Object
org.mapsforge.map.layer.Layer
org.mapsforge.map.layer.TileLayer<RendererJob>
slash.navigation.maps.mapsforge.mbtiles.TileMBTilesLayer
- All Implemented Interfaces:
org.mapsforge.map.model.common.Observer
public class TileMBTilesLayer
extends org.mapsforge.map.layer.TileLayer<RendererJob>
implements org.mapsforge.map.model.common.Observer
-
Field Summary
Fields inherited from class org.mapsforge.map.layer.TileLayer
hasJobQueue, isTransparent, jobQueue, tileCacheFields inherited from class org.mapsforge.map.layer.Layer
displayModel -
Constructor Summary
ConstructorsConstructorDescriptionTileMBTilesLayer(org.mapsforge.map.layer.cache.TileCache tileCache, org.mapsforge.map.model.MapViewPosition mapViewPosition, boolean isTransparent, MBTilesFile file, org.mapsforge.core.graphics.GraphicFactory graphicFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected RendererJobcreateJob(org.mapsforge.core.model.Tile tile) protected booleanisTileStale(org.mapsforge.core.model.Tile tile, org.mapsforge.core.graphics.TileBitmap bitmap) Whether the tile is stale and should be refreshed.protected voidonAdd()voidonChange()protected voidonRemove()voidsetDisplayModel(org.mapsforge.map.model.DisplayModel displayModel) Methods inherited from class org.mapsforge.map.layer.TileLayer
draw, getAlpha, getCacheTileMargin, getCacheZoomMinus, getCacheZoomPlus, getTileCache, retrieveLabelsOnly, setAlpha, setCacheTileMargin, setCacheZoomMinus, setCacheZoomPlus, setParentTilesRenderingMethods inherited from class org.mapsforge.map.layer.Layer
getDisplayModel, getPosition, isVisible, onDestroy, onLongPress, onScroll, onTap, requestRedraw, setVisible, setVisible
-
Constructor Details
-
Method Details
-
setDisplayModel
public void setDisplayModel(org.mapsforge.map.model.DisplayModel displayModel) - Overrides:
setDisplayModelin classorg.mapsforge.map.layer.TileLayer<RendererJob>
-
createJob
- Specified by:
createJobin classorg.mapsforge.map.layer.TileLayer<RendererJob>
-
isTileStale
protected boolean isTileStale(org.mapsforge.core.model.Tile tile, org.mapsforge.core.graphics.TileBitmap bitmap) Whether the tile is stale and should be refreshed. This method is called fromTileLayer.draw(BoundingBox, byte, Canvas, Point, Rotation)to determine whether the tile needs to be refreshed. A tile is considered stale if the timestamp of the layer'sdatabaseRendereris more recent than thebitmap'sTileBitmap.getTimestamp(). When a tile has become stale, the layer will first display the tile referenced bybitmapand attempt to obtain a fresh copy in the background. When a fresh copy becomes available, the layer will replace is and update the cache. If a fresh copy cannot be obtained for whatever reason, the stale tile will continue to be used until another#draw(BoundingBox, byte, Canvas, Point)operation requests it again.- Specified by:
isTileStalein classorg.mapsforge.map.layer.TileLayer<RendererJob>- Parameters:
tile- A tile.bitmap- The bitmap fortilecurrently held in the layer's cache.
-
onAdd
protected void onAdd()- Overrides:
onAddin classorg.mapsforge.map.layer.Layer
-
onRemove
protected void onRemove()- Overrides:
onRemovein classorg.mapsforge.map.layer.Layer
-
onChange
public void onChange()- Specified by:
onChangein interfaceorg.mapsforge.map.model.common.Observer
-