@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
40 lines (39 loc) • 1.58 kB
TypeScript
import GirafeSingleton from '../../base/GirafeSingleton';
import LayerWmts from '../../models/layers/layerwmts';
import { Extent } from 'ol/extent';
declare class OfflineManager extends GirafeSingleton {
private serviceWorker;
private database?;
private map;
private stateManager;
private configManager;
private get state();
private totalLength;
private counter;
private progressCallback?;
private storeVersion?;
private dbCacheName?;
private readonly tilesStoreName;
private readonly bboxStoreName;
private readonly vectorLayer;
constructor(type: string);
initializeOfflineState(isOffline: boolean): void;
private registerEvents;
/** Exports all the WMTS tiles for the layers in parameter and store them to local cache */
exportWMTSTiles(bbox: Extent, wmtsLayers: LayerWmts[], progressCallback?: CallableFunction): Promise<void>;
private openIndexedDB;
/** The offline manager works with a ServiceWorker in charge of intercepting
* the fetch requests and read the data from the local cache if the application
* is offline. This method defines the servicework object to use.
* Without this, the offline mode won't work.
*/
setServiceWorker(sw: ServiceWorker | null, storeVersion: number, dbCacheName: string): Promise<void>;
switchOffline(): void;
private getAllTileUrls;
private getTileUrlsForWmtsLayer;
private fetchAndSaveTiles;
private doWork;
private saveBoundingBox;
displayBoundBoxes(): Promise<void>;
}
export default OfflineManager;