Skip to content

Latest commit

 

History

History
271 lines (161 loc) · 5.68 KB

API.md

File metadata and controls

271 lines (161 loc) · 5.68 KB

Table of Contents

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

Parameters

MBTilesRasterOptions

Extends ImageTileOptions

Options for creating a MBTilesRasterSource

sqlWorkers

Number of parallel workers to use for retrieving tiles, @default 4

Type: number

layers

List of layer names to selectively include, @default everything

Type: Array<string>

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

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

tileGrid

Optional tile grid, refer to the Openlayers manual

Type: TileGrid

pool

Optional already open SQLiteHTTP pool (mutually exclusive with url)

Type: Promise<SQLiteHTTPPool>

mime

Optional MIME type for loaded tiles (see #68)

Type: string

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

Parameters

MBTilesVectorOptions

Extends VectorTileOptions

Options for creating a MBTilesVectorSource

sqlWorkers

Number of parallel workers to use for retrieving tiles, @default 4

Type: number

layers

List of layer names to selectively include, @default everything

Type: Array<string>

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

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

pool

Optional already open SQLiteHTTP pool (mutually exclusive with url)

Type: Promise<SQLiteHTTPPool>

SQLOptions

Shared options for all MBTiles

url

URL of the remote MBTiles source

Type: string

sqlWorkers

Number of parallel workers to use for retrieving tiles, @default 4

Type: number

maxSqlPageSize

Maximum expected page size in bytes for SQLite3 files, @default 4096

Type: number

sqlCacheSize

Memory to use for SQLite cache in KB, @default 4096

Type: number

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 | MBTilesVectorOptions)