public class TileVectorLayer extends AbstractTileLayerView
SVTiles图层即离线矢量图层,如果sdcard中没有离线矢量缓存SVTiles则不出图。
addToNetworkDownload, context, crs, curMapUrl, dpi, isGCSLayer, isLayerInited, layerBounds, layerCacheFileName, layerName, mapView, projection, resolutions, tileCount, totalTileCount, visible, visibleScales, zoomLevel
构造器和说明 |
---|
TileVectorLayer(Context context)
构造函数。
|
TileVectorLayer(Context context, AttributeSet attrs)
构造函数。
|
TileVectorLayer(Context context, AttributeSet attrs, int defStyle)
构造函数。
|
TileVectorLayer(Context context, java.lang.String svtilesPath)
构造函数。
|
TileVectorLayer(Context context, java.lang.String svtilesPath, java.lang.String mapUrl)
构造函数。
|
限定符和类型 | 方法和说明 |
---|---|
void |
asyncGetTilesFromCache()
异步去读取缓存数据,读取完毕刷新地图。
|
void |
destroy()
销毁当前 LayerView 对象,退出前调用。
|
protected com.supermap.android.maps.TileCacher |
getTileCacher()
获取android端瓦片的缓存。
|
void |
initTileContext(Tile tile)
初始化瓦片的内容 首先判断内存缓存对象是否存在,1.存在内存缓存对象且包含当前瓦片则读取缓存无需查询数据库获取直接返回,增强效率; 2.存在内存缓存对象但不包含当前瓦片 或 不存在内存缓存对象; 则判断SDCard缓存对象是否存在,存在且包含瓦片则把当前瓦片保持到内存缓存中后返回,增强效率; 3.不存在任何缓存对象则查询数据库获取瓦片,并保持于缓存起来(包含内存缓存和SDCard缓存)
|
void |
setCacheSize(int size)
设置缓存大小,单位是张,指明最多缓存多少瓦片
|
void |
setSVTilesPath(java.lang.String value)
设置SVTiles所在的路径,该路径相对于sdcard的路径,如"supermap/SVTiles/*.svtiles" 并读取SVTiles的源信息初始化图层状态
|
buildTile, clearCache, getBounds, getCRS, getMapView, getResolutionIndex, getResolutions, getScales, getURL, getZoomLevel, initProjection, isGCSLayer, isInitialized, isVisible, onDraw, setCRS, setLayerCacheFileName, setOpaqueRate, setURL, setVisible, validateZoomLevel
public TileVectorLayer(Context context)
构造函数。
context
- Activity的上下文public TileVectorLayer(Context context, AttributeSet attrs)
构造函数。
context
- Activity的上下文attrs
- 属性信息public TileVectorLayer(Context context, AttributeSet attrs, int defStyle)
构造函数。
context
- Activity的上下文attrs
- 属性信息defStyle
- 风格标识public TileVectorLayer(Context context, java.lang.String svtilesPath)
构造函数。
context
- Activity的上下文svtilesPath
- 设置SVTiles所在的路径,该路径相对于sdcard的路径,如"supermap/SVTiles/*.svtiles"public TileVectorLayer(Context context, java.lang.String svtilesPath, java.lang.String mapUrl)
构造函数。
context
- Activity的上下文svtilesPath
- 设置SVTiles所在的路径,该路径相对于sdcard的路径,如"supermap/SVTiles/*.svtiles"mapUrl
- 地图服务的url地址public void setSVTilesPath(java.lang.String value)
设置SVTiles所在的路径,该路径相对于sdcard的路径,如"supermap/SVTiles/*.svtiles" 并读取SVTiles的源信息初始化图层状态
value
-protected com.supermap.android.maps.TileCacher getTileCacher()
AbstractTileLayerView
获取android端瓦片的缓存。
getTileCacher
在类中 AbstractTileLayerView
public void initTileContext(Tile tile)
初始化瓦片的内容 首先判断内存缓存对象是否存在,1.存在内存缓存对象且包含当前瓦片则读取缓存无需查询数据库获取直接返回,增强效率; 2.存在内存缓存对象但不包含当前瓦片 或 不存在内存缓存对象; 则判断SDCard缓存对象是否存在,存在且包含瓦片则把当前瓦片保持到内存缓存中后返回,增强效率; 3.不存在任何缓存对象则查询数据库获取瓦片,并保持于缓存起来(包含内存缓存和SDCard缓存)
initTileContext
在类中 AbstractTileLayerView
tile
-public void asyncGetTilesFromCache()
AbstractTileLayerView
异步去读取缓存数据,读取完毕刷新地图。使用场景:当初始化完当前屏幕所需的瓦片后,根据已知瓦片,去异步读取离线数据缓存,保证不阻塞主线程 子类根据需要扩展实现,达到预期的效果,结合initTileContext(在其中保存所有初始化完成的瓦片list)接口使用,asyncGetTilesFromCache根据list异步读取瓦片缓存
public void destroy()
AbstractTileLayerView
销毁当前 LayerView 对象,退出前调用。
destroy
在类中 AbstractTileLayerView
public void setCacheSize(int size)
设置缓存大小,单位是张,指明最多缓存多少瓦片
size
- 缓存张数