Class MapLayersCollection

This class contains all the mapLayers

See theMapLayersCollection for the one and only one instance of this class

Source : file data/MapLayersCollection.js at line 36

Constructor

new MapLayersCollection ( )

The constructor

Source : file data/MapLayersCollection.js at line 63

Public getters and setters

readonly get defaultMapLayer : MapLayer

Get the defaultMapLayer

Source : file data/MapLayersCollection.js at line 138

Public methods

addMapLayers ( jsonLayers )

Add a MapLayer list to the list of available MapLayers. This method can only be called once

Source : file data/MapLayersCollection.js at line 117

Parameters

Name Type Description
jsonLayers Array of Object

The layer list to add (json object from TravelNotesLayers.json)

forEach ( fct )

Executes a function on each MapLayer in the collection

Source : file data/MapLayersCollection.js at line 110

Parameters

Name Type Description
fct Function

The function to execute

getMapLayer ( mapLayerName )

Gives a MapLayer object

Source : file data/MapLayersCollection.js at line 94

Parameters

Name Type Description
mapLayerName String

The name of the MapLayer to give

Returns

The asked MapLayer. If a provider key is needed and the key not available the defaultMapLayer is returned. If the layer is not found, the defaultMapLayer is returned
Type : MapLayer

Private properties

#defaultMapLayer : MapLayer

The mapLayer to use by default

Source : file data/MapLayersCollection.js at line 50

#mapLayers : Map of MapLayer

A JS map to store the mapLayers, ordered by name

Source : file data/MapLayersCollection.js at line 43

#mapLayersAdded : Boolean

A guard to block a second upload of the mapLayers

Source : file data/MapLayersCollection.js at line 57