java.lang.Object | ||
↳ | com.carto.layers.Layer | |
↳ | com.carto.layers.TileLayer |
![]() |
![]() |
An abstract base class for all tile layers.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
MapTile |
calculateMapTile(MapPos mapPos, int zoom)
Calculates the tile corresponding to given geographical coordinates and zoom level.
| ||||||||||
MapBounds |
calculateMapTileBounds(MapTile mapTile)
Calculates the bounds of given map tile.
| ||||||||||
MapPos |
calculateMapTileOrigin(MapTile mapTile)
Calculates the origin of given map tile.
| ||||||||||
void |
clearTileCaches(boolean all)
Clears layer tile caches.
| ||||||||||
synchronized void | delete() | ||||||||||
TileDataSource |
getDataSource()
Returns the data source assigned to this layer.
| ||||||||||
int |
getFrameNr()
Returns the current frame number.
| ||||||||||
int |
getMaxOverzoomLevel()
Gets the current maximum overzoom level for this layer.
| ||||||||||
int |
getMaxUnderzoomLevel()
Gets the current maximum underzoom level for this layer.
| ||||||||||
TileLoadListener |
getTileLoadListener()
Returns the tile load listener.
| ||||||||||
TileSubstitutionPolicy |
getTileSubstitutionPolicy()
Returns the current tile substitution policy.
| ||||||||||
TileDataSource |
getUTFGridDataSource()
Returns the tile data source of the associated UTF grid.
| ||||||||||
UTFGridEventListener |
getUTFGridEventListener()
Returns the UTF grid event listener.
| ||||||||||
float |
getZoomLevelBias()
Gets the current zoom level bias for this layer.
| ||||||||||
boolean |
isPreloading()
Returns the state of the preloading flag of this layer.
| ||||||||||
boolean |
isSynchronizedRefresh()
Returns the state of the synchronized refresh flag.
| ||||||||||
boolean |
isUpdateInProgress()
Tests whether this layer is being currently updated.
| ||||||||||
void |
setFrameNr(int frameNr)
Sets the frame number, only used for animated tiles.
| ||||||||||
void |
setMaxOverzoomLevel(int overzoomLevel)
Sets the maximum overzoom level for this layer.
| ||||||||||
void |
setMaxUnderzoomLevel(int underzoomLevel)
Sets the maximum underzoom level for this layer.
| ||||||||||
void |
setPreloading(boolean preloading)
Sets the state of preloading for this layer.
| ||||||||||
void |
setSynchronizedRefresh(boolean synchronizedRefresh)
Sets the state of the synchronized refresh flag.
| ||||||||||
void |
setTileLoadListener(TileLoadListener tileLoadListener)
Sets the tile load listener.
| ||||||||||
void |
setTileSubstitutionPolicy(TileSubstitutionPolicy policy)
Sets the current tile substitution policy.
| ||||||||||
void |
setUTFGridDataSource(TileDataSource dataSource)
Sets the tile data source of the associated UTF grid.
| ||||||||||
void |
setUTFGridEventListener(UTFGridEventListener utfGridEventListener)
Sets the UTF grid event listener.
| ||||||||||
void |
setZoomLevelBias(float bias)
Sets the zoom level bias for this layer.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Calculates the tile corresponding to given geographical coordinates and zoom level.
Note: zoom level bias is NOT applied, only discrete zoom level is used.
mapPos | Coordinates of the point in data source projection coordinate system. |
---|---|
zoom | Zoom level to use for the tile. |
Calculates the bounds of given map tile.
mapTile | The map tile to use. |
---|
Calculates the origin of given map tile.
mapTile | The map tile to use. |
---|
Clears layer tile caches. This will release memory allocated to tiles.
all | True if all tiles should be released, otherwise only preloading (invisible) tiles are released. |
---|
Returns the data source assigned to this layer.
Returns the current frame number.
Gets the current maximum overzoom level for this layer.
Gets the current maximum underzoom level for this layer.
Returns the tile load listener.
Returns the current tile substitution policy.
Returns the tile data source of the associated UTF grid. By default this is null.
Returns the UTF grid event listener.
Gets the current zoom level bias for this layer.
Returns the state of the preloading flag of this layer.
Returns the state of the synchronized refresh flag.
Tests whether this layer is being currently updated.
Sets the frame number, only used for animated tiles.
Loading a new frame may take some time, previous frame is shown during loading.
frameNr | The frame number to display. |
---|
Sets the maximum overzoom level for this layer.
If a tile for the given zoom level Z is not available, SDK will try to use tiles with zoom levels Z-1, ..., Z-MaxOverzoomLevel.
The default is 6.
overzoomLevel | The new maximum overzoom value. |
---|
Sets the maximum underzoom level for this layer.
If a tile for the given zoom level Z is not available, SDK will try to use tiles with zoom levels Z-1, ..., Z-MaxOverzoomLevel and then Z+1, ..., Z+MaxUnderzoomLevel.
The default is 3.
underzoomLevel | The new maximum underzoom value. |
---|
Sets the state of preloading for this layer. Preloading allows the downloading of tiles that are not
currently visible on screen, but are adjacent to ones that are. This means that the user can pan the map without
immediately noticing any missing tiles.
Enabling this option might introduce a small performance hit on slower devices. It should also be noted that this
will considerably increase network traffic if used with online maps. The default is false.
preloading | The new preloading state of the layer. |
---|
Sets the state of the synchronized refresh flag. If disabled all tiles will appear on screen
one by one as they finish loading. If enabled the map will wait for all the visible tiles to finish loading
and then show them all on screen together. This is useful for animated tiles.
synchronizedRefresh | The new state of the synchronized refresh flag. |
---|
Sets the tile load listener.
tileLoadListener | The tile load listener. |
---|
Sets the current tile substitution policy.
policy | The new substitution policy. Default is TILE_SUBSTITUTION_POLICY_ALL. |
---|
Sets the tile data source of the associated UTF grid.
dataSource | The data source to use. Can be null if UTF grid is not used. |
---|
Sets the UTF grid event listener.
utfGridEventListener | The UTF grid event listener. |
---|
Sets the zoom level bias for this layer.
Higher zoom level bias forces SDK to use more detailed tiles for given view compared to lower zoom bias.
The default bias is 0.
bias | The new bias value, both positive and negative fractional values are supported. |
---|