public class MBTilesLayerView extends AbstractTileLayerView
MBTiles图层即离线图层,如果sdcard中没有离线缓存MBTiles则也不发送请求即不出图。
addToNetworkDownload, context, crs, curMapUrl, dpi, isGCSLayer, isLayerInited, layerBounds, layerCacheFileName, layerName, mapView, projection, resolutions, tileCount, totalTileCount, visible, visibleScales, zoomLevel
构造器和说明 |
---|
MBTilesLayerView(Context context)
构造函数。
|
MBTilesLayerView(Context context, AttributeSet attrs)
构造函数。
|
MBTilesLayerView(Context context, AttributeSet attrs, int defStyle)
构造函数。
|
MBTilesLayerView(Context context, java.lang.String mbtilesPath)
构造函数。
|
限定符和类型 | 方法和说明 |
---|---|
void |
asyncGetTilesFromCache()
异步去读取缓存数据,读取完毕刷新地图。
|
void |
destroy()
资源释放,特别是关闭缓存数据库和终止子线程,建议推出应用时直接调用或是调用mapview的销毁
|
void |
initTileContext(Tile tile)
初始化瓦片的内容
|
void |
setMbtilesPath(java.lang.String value)
设置Mbtiles所在的路径,该路径相对于sdcard的路径,如"supermap/Mbtiles/*.mbtiles" 并读取Mbtiles的源信息初始化图层状态
|
buildTile, clearCache, getBounds, getCRS, getMapView, getResolutionIndex, getResolutions, getScales, getTileCacher, getURL, getZoomLevel, initProjection, isGCSLayer, isInitialized, isVisible, onDraw, setCRS, setLayerCacheFileName, setOpaqueRate, setURL, setVisible, validateZoomLevel
public MBTilesLayerView(Context context)
构造函数。
context
- Activity的上下文public MBTilesLayerView(Context context, AttributeSet attrs)
构造函数。
context
- Activity的上下文attrs
- 属性信息public MBTilesLayerView(Context context, AttributeSet attrs, int defStyle)
构造函数。
context
- Activity的上下文attrs
- 属性信息defStyle
- 风格标识public MBTilesLayerView(Context context, java.lang.String mbtilesPath)
构造函数。
context
- Activity的上下文mbtilesPath
- 设置Mbtiles所在的路径,该路径可以是绝对路径(/mnt/sdcard/supermap/*.mbtiles) 也可以是相对路径(相对于内置sdcard的路径,如"supermap/*.mbtiles"),建议使用绝对路径public void setMbtilesPath(java.lang.String value)
设置Mbtiles所在的路径,该路径相对于sdcard的路径,如"supermap/Mbtiles/*.mbtiles" 并读取Mbtiles的源信息初始化图层状态
value
-public void initTileContext(Tile tile)
初始化瓦片的内容
initTileContext
在类中 AbstractTileLayerView
tile
-public void asyncGetTilesFromCache()
AbstractTileLayerView
异步去读取缓存数据,读取完毕刷新地图。使用场景:当初始化完当前屏幕所需的瓦片后,根据已知瓦片,去异步读取离线数据缓存,保证不阻塞主线程 子类根据需要扩展实现,达到预期的效果,结合initTileContext(在其中保存所有初始化完成的瓦片list)接口使用,asyncGetTilesFromCache根据list异步读取瓦片缓存
public void destroy()
资源释放,特别是关闭缓存数据库和终止子线程,建议推出应用时直接调用或是调用mapview的销毁
destroy
在类中 AbstractTileLayerView