OpenLayers.Layer.Vector.RootContainer - OpenLayers

# OpenLayers.Layer.Vector.RootContainer

A special layer type to combine multiple vector layers inside a single renderer root container. This class is not supposed to be instantiated from user space, it is a helper class for controls that require event processing for multiple vector layers.

#### Inherits from

- OpenLayers.Layer.Vector

Summary

OpenLayers.Layer.Vector.RootContainer | A special layer type to combine multiple vector layers inside a single renderer root container.
Properties |
displayInLayerSwitcher | Set to false for this layer type
layers | Layers that are attached to this container.
Constructor |
OpenLayers.Layer.Vector.RootContainer | Create a new root container for multiple vector layer.
Functions |
display |
getFeatureFromEvent | walk through the layers to find the feature returned by the event
setMap |
removeMap |
collectRoots | Collects the root nodes of all layers this control is configured with and moveswien the nodes to this control’s layer
resetRoots | Resets the root nodes back into the layers they belong to.
handleChangeLayer | Event handler for the map’s changelayer event.

### Properties

### displayInLayerSwitcher

Set to false for this layer type

### layers

Layers that are attached to this container. Required config option.

### Constructor

### OpenLayers.Layer.Vector.RootContainer

Create a new root container for multiple vector layer. This constructor is not supposed to be used from user space, it is only to be used by controls that need feature selection across multiple vector layers.

#### Parameters

name | {String} A name for the layer
options | {Object} Optional object with non-default properties to set on the layer.

#### Required options properties

layers | {Array(OpenLayers.Layer.Vector)} The layers managed by this container

#### Returns

{OpenLayers.Layer.Vector.RootContainer} A new vector layer root container

### Functions

### display

> display: function()

### getFeatureFromEvent

> getFeatureFromEvent: function( | evt | )

walk through the layers to find the feature returned by the event

#### Parameters

evt | {Object} event object with a feature property

#### Returns

{OpenLayers.Feature.Vector}

### setMap

> setMap: function( | map | )

#### Parameters

map | {OpenLayers.Map}

### removeMap

> removeMap: function( | map | )

#### Parameters

map | {OpenLayers.Map}

### collectRoots

> collectRoots: function()

Collects the root nodes of all layers this control is configured with and moveswien the nodes to this control’s layer

### resetRoots

> resetRoots: function()

Resets the root nodes back into the layers they belong to.

### handleChangeLayer

> handleChangeLayer: function( | evt | )

Event handler for the map’s changelayer event. We need to rebuild this container’s layer dom if order of one of its layers changes. This handler is added with the setMap method, and removed with the removeMap method.

#### Parameters

evt | {Object}

> display: function()

> getFeatureFromEvent: function( | evt | )

walk through the layers to find the feature returned by the event

> setMap: function( | map | )

> removeMap: function( | map | )

> collectRoots: function()

Collects the root nodes of all layers this control is configured with and moveswien the nodes to this control’s layer

> resetRoots: function()

Resets the root nodes back into the layers they belong to.

> handleChangeLayer: function( | evt | )

Event handler for the map’s changelayer event.
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
Create a new root container for multiple vector layer.
Vector features use the OpenLayers.Geometry classes as geometry description.
Instances of OpenLayers.Map are interactive maps embedded in a web page.
Close