tile-cache
v3.0.0
Published
Client side splippy tile cache
Maintainers
Readme
tile-cache
Client side splippy tile cache
Install
$ npm install --save tile-cacheUsage
The following collections/stores are provided by tile cache:
- tile - map tiles
- font - glyphs needed to render labels
- json - styles and other json data
- image - sprites
tile-cache methods take a store name as the first parameter. The examples below us tile store.
const tileCache = require('tile-cache');
const key = [0, 3, 5]; // x, y, zoom
let tile; // Blob or ArrayBuffer representing tile
await tileCache.put('tile', key, tile);
// tile is now in cache
tile = await tileCache.get('tile', key);
// tile retrieved
const inCache = await tileCache.check('tile', key);
// inCache is truthy is tile was in cache
await tileCache.remove('tile', key);
// specific tile is removed from cache
await tileCache.drop('tile');License
MIT © Damian Krzeminski
