Click or drag to resize

Telogis.GeoBase.MapLayers.LayerCollection

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release

A wrapper class that contains multiple map layers so that they can be treated as a single layer. While such a collection can be referenced by ID, it is not bound to any specific map.

Constructor
NameDescription
MapLayers.LayerCollection(config)

Arguments

  • config (Object) - Configuration properties for the MapLayers.LayerCollection.

    Properties
    NameTypeDescription
    idString

    The string ID used to refer to the layer collection. This is purely for reference, as no underlying DOM structure is created for a MapLayers.LayerCollection.

    layersArray

    An array of references to layer instances or their IDs that describes the layers to add to the collection initially.

Functions
NameDescription
add (String layer)

Adds a layer to the collection.

ArgumentsReturns

MapLayers.AbstractLayer - A reference to the layer just added, or null if it could not be found. If the method was given a LayerCollection, nothing is returned.

destroy ()

Frees resources used by the layer collection by destroying each of the layers it contains.

remove (String layer)

Removes a layer from the collection.

ArgumentsReturns

MapLayers.AbstractLayer - A reference to the layer just removed, or null if it could not be found. If the method was given a LayerCollection, nothing is returned.

setMap (string map)

Sets the map that all the MapLayers.LayerCollection's layers lie on by calling MapLayers.AbstractLayer.setMap method of each.

Arguments
top (Class Type, Function filter)

Gets a reference to the layer of the specified type that was most recently added to this MapLayers.LayerCollection.

Arguments
  • (Optional) Type (Class) - The type of layer to look for. Defaults to MapLayers.AbstractLayer.

  • (Optional) filter (Function) - A function used to perform additional filtering of the layers in this collection. Defaults to null.

    ArgumentsReturns

    Boolean - True if the specified layer should be included in the search; false to exclude it.

Returns

MapLayers.AbstractLayer - A reference to the topmost layer that is an instance of MapLayers.LayerCollection.top.Type.

update (Number updateType)

Updates each layer in the collection if the map is invalidated.

Arguments
  • updateType (Number) - The type of update to apply.

Properties
NameTypeDescription
idString

The string identifier used to refer to this layer in the MapLayers hash, much the same as the regular MapLayers.AbstractLayer.id.