# 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, ngeoBackgroundLayerMgr, ngeoOfflineGutter): default

- #### 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

  #### Ng Inject

  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 Promise<void>

  A promise

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

### configureLocalforage

- configureLocalforage(): void

- #### Returns void

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

### createLayerMetadatas

- createLayerMetadatas(map, userExtent): OfflineLayerMetadata[]

- #### Parameters

  - map: Map

    The map to work on.

  - userExtent: Extent

    The extent selected by the user.

  #### Returns OfflineLayerMetadata[]

  the downloadable layers and metadata.

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

### createLocalforage

- createLocalforage(): any

- #### Returns any

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

### estimateLoadDataSize

- estimateLoadDataSize(map): number

- #### Parameters

  - map: Map

    A map

  #### Returns number

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

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

### getExtentByZoom

- getExtentByZoom(map, layer, ancestors, userExtent): OfflineExtentByZoom[]

- #### 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[]

  The extent to download per zoom level

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

### getItem

- getItem(key): Promise<any>

- #### Parameters

  - key: string

    The key

  #### Returns Promise<any>

  A promise

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

### getLayerKey

- getLayerKey(layerItem): string

- #### Parameters

  - layerItem: OfflineLayerMetadata

    The layer metadata

  #### Returns string

  A key identifying an offline layer and used during restore.

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

### getMaxNumberOfParallelDownloads

- getMaxNumberOfParallelDownloads(): number

- #### Returns number

  The number

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

### hasOfflineData

- hasOfflineData(): boolean

- #### Returns boolean

  whether some offline data is available in the storage

  #### Export

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

### onTileDownloadError

- onTileDownloadError(progress): Promise<void>

- #### Parameters

  - progress: number

    The progress

  #### Returns Promise<void>

  A promise

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

### onTileDownloadSuccess

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

- #### Parameters

  - progress: number

    The download progress

  - tile: OfflineTile

    The tile

  #### Returns Promise<void>

  A promise

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

### recreateOfflineLayer

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

- #### Parameters

  - offlineLayer: OfflinePersistentLayer

    The layer to recreate

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

  the layer.

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

### removeItem

- removeItem(key): Promise<any>

- #### Parameters

  - key: string

    .

  #### Returns Promise<any>

  .

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

### setHasOfflineData

- setHasOfflineData(value): 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, value): Promise<any>

- #### Parameters

  - key: string

    The key

  - value: any

    A value

  #### Returns Promise<any>

  A promise

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

### traceGetSetItem

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

- Hook to allow measuring get/set item performance.

  #### Parameters

  - msg: string

    A message

  - key: string

    The key to work on

  - promise: Promise<any>

    A promise

  #### Returns Promise<any>

  The promise we passed

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