ol-mbtiles
Version:
MBTiles format reader for Openlayers
272 lines (161 loc) • 5.82 kB
Markdown
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
### Table of Contents
* [MBTilesRasterSource][1]
* [Parameters][2]
* [MBTilesRasterOptions][3]
* [sqlWorkers][4]
* [layers][5]
* [minZoom][6]
* [maxZoom][7]
* [tileGrid][8]
* [pool][9]
* [mime][10]
* [MBTilesVectorSource][11]
* [Parameters][12]
* [MBTilesVectorOptions][13]
* [sqlWorkers][14]
* [layers][15]
* [minZoom][16]
* [maxZoom][17]
* [pool][18]
* [SQLOptions][19]
* [url][20]
* [sqlWorkers][21]
* [maxSqlPageSize][22]
* [sqlCacheSize][23]
* [backendType][24]
* [importMBTiles][25]
* [Parameters][26]
## MBTilesRasterSource
**Extends ImageTileSource**
A tile source in a remote .mbtiles file accessible by HTTP
WARNING
If your application continuously creates and removes MBTilesSource
objects, special care must be taken to properly dispose of them.
An MBTilesSource creates a thread pool that the JS engine is unable to
automatically garbage-collect unless the dispose() method
is invoked.
If you need to dispose a map that can potentially contain
MBTilesSource objects, check loadExample() in
[https://github.com/mmomtchev/ol-mbtiles/blob/main/examples/index.ts#L15][27]
### Parameters
* `options` **[MBTilesRasterOptions][3]** options
## MBTilesRasterOptions
**Extends ImageTileOptions**
Options for creating a MBTilesRasterSource
### sqlWorkers
Number of parallel workers to use for retrieving tiles, @default 4
Type: [number][28]
### layers
List of layer names to selectively include, @default everything
Type: [Array][29]<[string][30]>
### minZoom
Alternative method of specifying minZoom, mutually exclusive with tileGrid, requires explicit projection.
This refers to the available zoom levels of the tiled data and it is different from the OpenLayers minZoom
parameter that applies to the layer.
Type: [number][28]
### maxZoom
Alternative method of specifying maxZoom, mutually exclusive with tileGrid, requires explicit projection
This refers to the available zoom levels of the tiled data and it is different from the OpenLayers maxZoom
parameter that applies to the layer.
Type: [number][28]
### tileGrid
Optional tile grid, refer to the Openlayers manual
Type: TileGrid
### pool
Optional already open SQLiteHTTP pool (mutually exclusive with url)
Type: [Promise][31]\<SQLiteHTTPPool>
### mime
Optional MIME type for loaded tiles (see [https://github.com/mmomtchev/ol-mbtiles/issues/68][32])
Type: [string][30]
## MBTilesVectorSource
**Extends VectorTileSource**
A tile source in a remote .mbtiles file accessible by HTTP
WARNING
If your application continuously creates and removes MBTilesSource
objects, special care must be taken to properly dispose of them.
An MBTilesSource creates a thread pool that the JS engine is unable to
automatically garbage-collect unless the dispose() method
is invoked.
If you need to dispose a map that can potentially contain
MBTilesSource objects, check loadExample() in
[https://github.com/mmomtchev/ol-mbtiles/blob/main/examples/index.ts#L15][27]
### Parameters
* `options` **[MBTilesVectorOptions][13]** options
## MBTilesVectorOptions
**Extends VectorTileOptions**
Options for creating a MBTilesVectorSource
### sqlWorkers
Number of parallel workers to use for retrieving tiles, @default 4
Type: [number][28]
### layers
List of layer names to selectively include, @default everything
Type: [Array][29]<[string][30]>
### minZoom
Minimum available zoom level.
This refers to the available zoom levels of the tiled data and it is different from the OpenLayers minZoom
parameter that applies to the layer.
Type: [number][28]
### maxZoom
Maximum available zoom level.
This refers to the available zoom levels of the tiled data and it is different from the OpenLayers maxZoom
parameter that applies to the layer.
Type: [number][28]
### pool
Optional already open SQLiteHTTP pool (mutually exclusive with url)
Type: [Promise][31]\<SQLiteHTTPPool>
## SQLOptions
Shared options for all MBTiles
### url
URL of the remote MBTiles source
Type: [string][30]
### sqlWorkers
Number of parallel workers to use for retrieving tiles, @default 4
Type: [number][28]
### maxSqlPageSize
Maximum expected page size in bytes for SQLite3 files, @default 4096
Type: [number][28]
### sqlCacheSize
Memory to use for SQLite cache in KB, @default 4096
Type: [number][28]
### backendType
Use a specific backend type, @default 'shared'
Type: any
## importMBTiles
Automatically import MBTiles metadata and return an options object
compatible with the source constructors.
### Parameters
* `opt` **any** 
Returns **([MBTilesRasterOptions][3] | [MBTilesVectorOptions][13])** 
[1]: #mbtilesrastersource
[2]: #parameters
[3]: #mbtilesrasteroptions
[4]: #sqlworkers
[5]: #layers
[6]: #minzoom
[7]: #maxzoom
[8]: #tilegrid
[9]: #pool
[10]: #mime
[11]: #mbtilesvectorsource
[12]: #parameters-1
[13]: #mbtilesvectoroptions
[14]: #sqlworkers-1
[15]: #layers-1
[16]: #minzoom-1
[17]: #maxzoom-1
[18]: #pool-1
[19]: #sqloptions
[20]: #url
[21]: #sqlworkers-2
[22]: #maxsqlpagesize
[23]: #sqlcachesize
[24]: #backendtype
[25]: #importmbtiles
[26]: #parameters-2
[27]: https://github.com/mmomtchev/ol-mbtiles/blob/main/examples/index.ts#L15
[28]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[29]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
[30]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[31]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
[32]: https://github.com/mmomtchev/ol-mbtiles/issues/68