# Class default

implements {import('ngeo/offline/index').OfflineOnTileDownload}

#### Hierarchy

- Observable
  - default

- Defined in src/offline/Configuration.js:44

#####
Index

### Constructors

constructor

### Properties

localforage_

### Methods

clear
configureLocalforage
createLayerMetadatas
createLocalforage
estimateLoadDataSize
getExtentByZoom
getItem
getLayerKey
getMaxNumberOfParallelDownloads
hasOfflineData
onTileDownloadError
onTileDownloadSuccess
recreateOfflineLayer
removeItem
setHasOfflineData
setItem
traceGetSetItem

## Constructors

### constructor

- new default($rootScope: IScope, ngeoBackgroundLayerMgr: MapBackgroundLayerManager, ngeoOfflineGutter: number): default

- ### Ng Inject

  #### Parameters

  - ##### $rootScope: IScope

    The rootScope provider.

  - ##### ngeoBackgroundLayerMgr: MapBackgroundLayerManager

    Background layer manager.

  - ##### ngeoOfflineGutter: number

    A gutter around the tiles to download (to avoid cut symbols)

  #### Returns default

  Overrides olObservable.constructor

  - Defined in src/offline/Configuration.js:52

## Properties

### localforage_

localforage_: any

- Defined in src/offline/Configuration.js:55

## Methods

### clear

- clear(): Promise<void>

- ### Returns

  A promise

  #### Returns Promise<void>

  - Defined in src/offline/Configuration.js:194

### configureLocalforage

- configureLocalforage(): void

- #### Returns void

  - Defined in src/offline/Configuration.js:155

### createLayerMetadatas

- createLayerMetadatas(map: Map, userExtent: Extent): OfflineLayerMetadata[]

- ### Returns

  the downloadable layers and metadata.

  #### Parameters

  - ##### map: Map

    The map to work on.

  - ##### userExtent: Extent

    The extent selected by the user.

  #### Returns OfflineLayerMetadata[]

  - Defined in src/offline/Configuration.js:299

### createLocalforage

- createLocalforage(): any

- #### Returns any

  - Defined in src/offline/Configuration.js:141

### estimateLoadDataSize

- estimateLoadDataSize(map: Map): number

- ### Returns

  An "estimation" of the size of the data to download

  #### Parameters

  - ##### map: Map

    A map

  #### Returns number

  - Defined in src/offline/Configuration.js:204

### getExtentByZoom

- getExtentByZoom(map: Map, layer: Layer<Source, LayerRenderer<any>>, ancestors: LayerGroup[], userExtent: Extent): OfflineExtentByZoom[]

- ### Returns

  The extent to download per zoom level

  #### Parameters

  - ##### map: Map

    A map

  - ##### layer: Layer<Source, LayerRenderer<any>>

    A layer

  - ##### ancestors: LayerGroup[]

    The ancestors of that layer

  - ##### userExtent: Extent

    The extent selected by the user.

  #### Returns OfflineExtentByZoom[]

  - Defined in src/offline/Configuration.js:246

### getItem

- getItem(key: string): Promise<any>

- ### Returns

  A promise

  #### Parameters

  - ##### key: string

    The key

  #### Returns Promise<any>

  - Defined in src/offline/Configuration.js:167

### getLayerKey

- getLayerKey(layerItem: OfflineLayerMetadata): string

- ### Returns

  A key identifying an offline layer and used during restore.

  #### Parameters

  - ##### layerItem: OfflineLayerMetadata

    The layer metadata

  #### Returns string

  - Defined in src/offline/Configuration.js:212

### getMaxNumberOfParallelDownloads

- getMaxNumberOfParallelDownloads(): number

- ### Returns

  The number

  #### Returns number

  - Defined in src/offline/Configuration.js:397

### hasOfflineData

- hasOfflineData(): boolean

- ### Export

  ### Returns

  whether some offline data is available in the storage

  #### Returns boolean

  - Defined in src/offline/Configuration.js:114

### onTileDownloadError

- onTileDownloadError(progress: number): Promise<void>

- ### Returns

  A promise

  #### Parameters

  - ##### progress: number

    The progress

  #### Returns Promise<void>

  - Defined in src/offline/Configuration.js:234

### onTileDownloadSuccess

- onTileDownloadSuccess(progress: number, tile: OfflineTile): Promise<void>

- ### Returns

  A promise

  #### Parameters

  - ##### progress: number

    The download progress

  - ##### tile: OfflineTile

    The tile

  #### Returns Promise<void>

  - Defined in src/offline/Configuration.js:221

### recreateOfflineLayer

- recreateOfflineLayer(offlineLayer: OfflinePersistentLayer): Layer<Source, LayerRenderer<any>>

- ### Returns

  the layer.

  #### Parameters

  - ##### offlineLayer: OfflinePersistentLayer

    The layer to recreate

  #### Returns Layer<Source, LayerRenderer<any>>

  - Defined in src/offline/Configuration.js:381

### removeItem

- removeItem(key: string): Promise<any>

- ### Returns

  .

  #### Parameters

  - ##### key: string

    .

  #### Returns Promise<any>

  - Defined in src/offline/Configuration.js:176

### setHasOfflineData

- setHasOfflineData(value: boolean): void

- #### Parameters

  - ##### value: boolean

    whether there is offline data available in the storage.

  #### Returns void

  - Defined in src/offline/Configuration.js:121

### setItem

- setItem(key: string, value: any): Promise<any>

- ### Returns

  A promise

  #### Parameters

  - ##### key: string

    The key

  - ##### value: any

    A value

  #### Returns Promise<any>

  - Defined in src/offline/Configuration.js:186

### traceGetSetItem

- traceGetSetItem(msg: string, key: string, promise: Promise<any>): Promise<any>

- Hook to allow measuring get/set item performance.

  ### Returns

  The promise we passed

  #### Parameters

  - ##### msg: string

    A message

  - ##### key: string

    The key to work on

  - ##### promise: Promise<any>

    A promise

  #### Returns Promise<any>

  - Defined in src/offline/Configuration.js:137

Generated using TypeDoc