Class: module:Configuration

ngeo.offline.module:Configuration.ngeo.offline.module:Configuration

new module:Configuration($rootScope, ngeoBackgroundLayerMgr, ngeoOfflineGutter)

Parameters:
Name Type Description
$rootScope !angular.Scope

The rootScope provider.

ngeoBackgroundLayerMgr ngeo.map.BackgroundLayerMgr

The background layer manager

ngeoOfflineGutter number

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

Implements:
  • ngeox.OfflineOnTileDownload

Members

(protected) hasData: boolean

Methods

clear()

Returns:
Promise

A promise

createLayerMetadatas(map, userExtent)

Parameters:
Name Type Description
map ol.Map

The map to work on.

userExtent ol.Extent

The extent selected by the user.

Returns:
!Array

the downloadable layers and metadata.

estimateLoadDataSize(map)

Parameters:
Name Type Description
map !ol.Map

A map

Returns:
number

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

getExtentByZoom(map, layer, ancestors, userExtent)

Parameters:
Name Type Description
map ol.Map

A map

layer ol.layer.Layer

A layer

ancestors Array

The ancestors of that layer

userExtent ol.Extent

The extent selected by the user.

Returns:
Array

The extent to download per zoom level

getItem(key)

Parameters:
Name Type Description
key string

The key

Returns:
Promise

A promise

getLayerKey(layerItem)

Parameters:
Name Type Description
layerItem ngeox.OfflineLayerMetadata

The layer metadata

Returns:
string

A key identifying an offline layer and used during restore.

getMaxNumberOfParallelDownloads()

Returns:
number

The number

hasOfflineData()

Returns:
boolean

whether some offline data is available in the storage

(protected) initializeHasOfflineData()

onTileDownloadError(progress)

Parameters:
Name Type Description
progress number

The progress

Returns:
Promise

A promise

onTileDownloadSuccess(progress, tile)

Parameters:
Name Type Description
progress number

The download progress

tile ngeox.OfflineTile

The tile

Returns:
Promise

A promise

recreateOfflineLayer(offlineLayer)

Parameters:
Name Type Description
offlineLayer ngeox.OfflinePersistentLayer

The layer to recreate

Returns:
ol.layer.Layer

the layer.

removeItem(key)

Parameters:
Name Type Description
key string

.

Returns:

setHasOfflineData(value)

Parameters:
Name Type Description
value boolean

whether there is offline data available in the storage.

setItem(key, value)

Parameters:
Name Type Description
key string

The key

value *

A value

Returns:
Promise

A promise

(protected) sourceImageWMSToTileWMS(source, projection)

Parameters:
Name Type Description
source ol.source.Source

An ImageWMS source

projection ol.proj.Projection

The projection

Returns:
ol.source.Source

A tiled equivalent source

traceGetSetItem(msg, key, promise)

Hook to allow measuring get/set item performance.

Parameters:
Name Type Description
msg string

A message

key string

The key to work on

promise Promise

A promise

Returns:
Promise

The promise we passed