-
The access token to access the resource. This should be a valid, non-empty, Mapbox access token
-
The base URL. Leave as
nil
unless you have a reason to change this. -
The file URL to the cache. The default,
nil
, will choose an appropriate location on the device. The default location is excluded from backups. -
The path to the assets. The default,
nil
, uses the main bundle. -
The tile store instance
This setting can be applied only if tile store usage is enabled, otherwise it is ignored.
If not set and tile store usage is enabled, a tile store at the default location will be created and used.
Attention
If you create a
ResourceOptions
(rather than usingResourceOptionsManager
to manage one) that uses a custom TileStore, you will need to ensure that theTileStore
is initialized with a valid access token.For example:
tileStore.setOptionForKey(TileStoreOptions.mapboxAccessToken, value: accessToken)
-
Tile store usage mode
-
Initialize a
ResourceOptions
, used by bothMapView
s andSnapshotter
sAttention
If
tileStoreUsageMode
is.readonly
(the default): Tile loading first checks the tile store when requesting a tile: If a tile pack is already loaded, the tile will be extracted and returned. Otherwise, the implementation falls back to requesting the individual tile and storing it in the disk cache.If
tileStoreUsageMode
is.readAndUpdate
: All tile requests are converted to tile pack requests, i.e. the tile pack that includes the requested tile will be loaded, and the tile extracted from it. In this mode, no individual tile requests will be made.This mode can be useful if the map trajectory is predefined and the user cannot pan freely (e.g. navigation use cases), so that there is a good chance tile packs are already loaded in the vicinity of the user.
If users can pan freely, this mode is not recommended. Otherwise, panning will download tile packs instead of using individual tiles. Note that this means that we could first download an individual tile, and then a tile pack that also includes this tile. The individual tile in the disk cache won’t be used as long as the up-to-date tile pack exists in the cache.