Class: OverlayGroup

Cadcorp.GeognoSIS.OverlayGroup

new OverlayGroup(config)

Represents an overlay group
Parameters:
Name Type Description
config Object Configuration for this object. The config supplied directly extends the control

Members

End

Properties:
Name Type Description
End number The end index for layers in this group

events

Properties:
Name Type Description
events Cadcorp.Util.Events The events object

expanded

Properties:
Name Type Description
expanded boolean True if this group is expanded, otherwise false

initialConfig

Properties:
Name Type Description
initialConfig Object The config option passed to the constructor

layerNames

Properties:
Name Type Description
layerNames Array.<string> The name of the open layers overlays that can be added to this group

layers

Properties:
Name Type Description
layers Array.<Object> The layers in this group

mapLayer

Properties:
Name Type Description
mapLayer string The name of the composite layer

Name

Properties:
Name Type Description
Name string The name of this group

Start

Properties:
Name Type Description
Start number The start index for layers in this group

visible

Properties:
Name Type Description
visible boolean True if all the overlays in this group are visible, otherwise false

Methods

addLayer(layer)

Adds a layer to the group
Parameters:
Name Type Description
layer Object The layer to add

calcGroupVisibility() → {boolean}

Works out the overall visibility of the group.
Returns:
True of all layers in the group are visibile, otherwise false
Type
boolean

isLayerIndexInGroup(index) → {boolean}

Tests if an index is in the range defined by Start and End
Parameters:
Name Type Description
index number The index of the layer to test
Returns:
True if index is in the range defined by Start and End, otherwise false
Type
boolean

isLayerInGroup(layer) → {boolean}

Tests if a layer is in the group
Parameters:
Name Type Description
layer Object The layer to test
Returns:
True if index is in the group, otherwise false
Type
boolean

populateLayers(mapId)

Populate this group with layers
Parameters:
Name Type Description
mapId string The id of the map

redraw(layer)

Redraw the layer
Parameters:
Name Type Description
layer Object The layer to redraw.

setVisibility(visibility)

Sets the visiblity of all layer in the group
Parameters:
Name Type Description
visibility boolean True to make the all the layers visible, otherwise false