Package globus.glmap
Class GLMapRasterTileSource
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapRasterTileSource
- All Implemented Interfaces:
GLMapTileSource
GLMapRasterTileSource setups custom raster tile source.-
Constructor Summary
ConstructorsConstructorDescriptionGLMapRasterTileSource(GLMapStorageFile cacheFileName) Default constructor of GLMapRasterTileSource -
Method Summary
Modifier and TypeMethodDescriptionandroid.graphics.BitmapbitmapForTilePos(int x, int y, int z) Gets bitmap of tile.longReturns size of cache databasevoidDrops cached tilesfloatReturns opacity of layer.intReturns size of tile in points.voidsetAttributionText(String text) Sets attribution text.voidsetOpacity(float opacity) Sets opacity of layervoidsetOverzoom(boolean overzoom) Allows to draw tiles after maximum zoomvoidsetTileRefreshTimeInterval(long tileRefreshTimeInterval) Cached tile will be refreshed if it will stay in cache more than given time.voidsetTileSize(int tileSize) Sets size of tile in points.voidsetValidZoomMask(int validZoomMask) Defines valid zooms for tile source.urlForTilePos(int x, int y, int z) Gets url of tile.voidwillAttach(GLMapViewRenderer mapView) Called when layer will be attached to map viewvoidwillDetach(GLMapViewRenderer mapView) Called when layer will be detached from map viewMethods inherited from class globus.glmap.GLNativeObject
dispose
-
Constructor Details
-
GLMapRasterTileSource
Default constructor of GLMapRasterTileSource- Parameters:
cacheFileName- Cache database file name. IfcacheFileNameisnullno caching will happen.- Throws:
OutOfMemoryError
-
-
Method Details
-
urlForTilePos
Gets url of tile. Default implementation return nil.- Parameters:
x- x coordinate of tiley- y coordinate of tilez- z coordinate of tile- Returns:
- URL of the tile
-
bitmapForTilePos
@Nullable public android.graphics.Bitmap bitmapForTilePos(int x, int y, int z) Gets bitmap of tile. Default implementation return nil.- Parameters:
x- x coordinate of tiley- y coordinate of tilez- z coordinate of tile- Returns:
- URL of the tile
-
setTileRefreshTimeInterval
public void setTileRefreshTimeInterval(long tileRefreshTimeInterval) Cached tile will be refreshed if it will stay in cache more than given time. By default tileRefreshTimeInterval is -1. If tileRefreshTimeInterval less than zero no tile refreshing will be triggered.- Parameters:
tileRefreshTimeInterval- New refresh time interval for source
-
dropCache
public void dropCache()Drops cached tiles -
cacheSize
public long cacheSize()Returns size of cache database- Returns:
- size of cache database in bytes.
-
setValidZoomMask
public void setValidZoomMask(int validZoomMask) Defines valid zooms for tile source. Default is 0xFFFFFFFF.- Parameters:
validZoomMask- New zoom mask for tile source
-
setTileSize
public void setTileSize(int tileSize) Sets size of tile in points. Default is 256.- Parameters:
tileSize- New tile size for tile source
-
getTileSize
public int getTileSize()Returns size of tile in points. Default is 256- Returns:
- tile size in points
-
setAttributionText
Sets attribution text. Default is "© OpenStreetMap"- Parameters:
text- New attribution text for tile source
-
setOverzoom
public void setOverzoom(boolean overzoom) Allows to draw tiles after maximum zoom- Parameters:
overzoom- if `true` will draw tiles after maximum zoom
-
setOpacity
public void setOpacity(float opacity) Sets opacity of layer- Parameters:
opacity- new opacity of layer
-
getOpacity
public float getOpacity()Returns opacity of layer. Default is 1.0f- Returns:
- opacity of layer
-
willAttach
Description copied from interface:GLMapTileSourceCalled when layer will be attached to map view- Specified by:
willAttachin interfaceGLMapTileSource- Parameters:
mapView- map view where layer will be attached
-
willDetach
Description copied from interface:GLMapTileSourceCalled when layer will be detached from map view- Specified by:
willDetachin interfaceGLMapTileSource- Parameters:
mapView- map view from where layer will be detached
-