AtlasCT.com
User Manual v5.0

LayersCollection

Inheritance: Layer > LayersCollection

The LayersCollection class stores a collection of layers.

In order to add a layer to the map, you should use the LocalVectorLayer or RemoteVectorLayer to store the shapes you would like to show on the map.
Any of the VectorLayer objects should be added to the map’s LayersManager (the LayersManager class inherits from the LayersCollection class)

See understanding the layers architecture


Summary
Inheritance: Layer > LayersCollection
The LayersCollection constructor.
Adds a new layer to the existing layers collection.
Creates a new local vector layer and add it as a child of the existing layers collection.
Creates a new remote vector layer and add it as a child of the existing layers collection.
Returns a reference to the layer instance with the specified name, or null if there is no layer with the specified name.
Returns a list of layers within the layer collection.
Removes a layer from the existing layers collection.

Constructors

LayersCollection

LayersCollection(string name)

The LayersCollection constructor.

Parameters

nameThe name of the new layers collection

Methods

addLayer

addLayer(Layer layer)

Adds a new layer to the existing layers collection.

Parameters

layerA new layer to add.

See Also

removeLayer

createLocalVectorLayer

LocalVectorLayer createLocalVectorLayer(string name)

Creates a new local vector layer and add it as a child of the existing layers collection.

Parameters

nameThe name of the new local vector layer.

Returns

A reference to the newly created local vector layer.

See Also

LocalVectorLayer, addLayer, removeLayer

createRemoteVectorLayer

RemoteVectorLayer createRemoteVectorLayer(string name)

Creates a new remote vector layer and add it as a child of the existing layers collection.

Parameters

nameThe name of the new remote vector layer.

Returns

A reference to the newly created remote vector layer.

See Also

RemoteVectorLayer, addLayer, removeLayer

getLayerByName

Layer getLayerByName(string name)

Returns a reference to the layer instance with the specified name, or null if there is no layer with the specified name.

Parameters

nameThe layer name.

Returns

A reference to the layer instance, or null if there is no layer with the specified name.

See Also

addLayer, removeLayer

getLayers

Array[] Layer getLayers()

Returns a list of layers within the layer collection.

Returns

List of layers

removeLayer

removeLayer(string name)

Removes a layer from the existing layers collection.

Parameters

nameThe layer name to be removed.

See Also

addLayer

Inheritance: EventListener > Layer
LayersCollection(string name)
The LayersCollection constructor.
LocalVectorLayer createLocalVectorLayer(string name)
Creates a new local vector layer and add it as a child of the existing layers collection.
RemoteVectorLayer createRemoteVectorLayer(string name)
Creates a new remote vector layer and add it as a child of the existing layers collection.
addLayer(Layer layer)
Adds a new layer to the existing layers collection.
removeLayer(string name)
Removes a layer from the existing layers collection.
Layer getLayerByName(string name)
Returns a reference to the layer instance with the specified name, or null if there is no layer with the specified name.
Array[] Layer getLayers()
Returns a list of layers within the layer collection.
Inheritance: Layer > VectorLayer > LocalVectorLayer
Inheritance: Layer > VectorLayer > RemoteVectorLayer
Inheritance: Layer > VectorLayer
Inheritance: Layer > LayersCollection > LayersManager