CorePlugins

# Class: LayerNode Source Location: /coreplugins/layers/client/ClientLayers.php
### Class Overview
Model object for layer nodes. Each node contain a reference to a BaseLayer, as defined in the MapInfo structure. | ### Variables $children $layer | ### Methods dropChild filterNodes getLayersMap setChildren __clone
### Class Details [line 95] Model object for layer nodes. Each node contain a reference to a BaseLayer, as defined in the MapInfo structure. This object has knowledge of its children and is capable of recursively traversing the tree. [ Top ] ### Class Variables #### $children = [line 107] The list of children of this layer. Empty if no children. #### Tags:
var: | Array of LayerBase objects
access: | public
Type: | array
[ Top ] #### $layer = [line 101] A reference to the layer object defined in MapInfo. #### Tags:
access: | public
Type: | LayerBase
[ Top ] ### Class Methods ### method dropChild [line 155]
`void dropChild( string $id)`
Removes a child from this node. #### Tags:
access: | public
#### Parameters:
string | $id | the id of the child to remove.
[ Top ] ### method filterNodes [line 167]
`void filterNodes( callback $filterCallback)`
Recursive method to remove unwanted nodes from this tree. The callback function will be called with a node as argument. If it returns true, the node will be removed from the tree. #### Tags:
access: | public
#### Parameters:
callback | $filterCallback | the callback function to call to filter the unwated nodes. It may be a function string, or layer of object, method.
[ Top ] ### method getLayersMap [line 184]
`the getLayersMap( mixed $layersMap)`
Flattens this tree of nodes to a map of (layerId => Layer object) #### Tags:
return: | flattened map of layer objects, indexed by their id.
access: | public
[ Top ] ### method setChildren [line 120]
`void setChildren( array $layersMap, mixed $switchId)`
Assign a layer to this node, and recursively set this node's children. The argument passed to this method is a flat associative array of (layerId => Layer) elements. This method is used to initialize the node tree from a flat list, as given by the MapInfo object. #### Tags:
access: | public
#### Parameters:
array | $layersMap | flat map of layerId's to layer objects. This object will be given to this node children recursively, to let them build the sub nodes of the tree
[ Top ] ### method __clone [line 139]
`void __clone( )`
Clones a tree of nodes. The layers referenced by the nodes are shallow copied. #### Tags:
access: | public
[ Top ] Documentation generated on Fri, 21 Sep 2007 13:30:38 +0200 by phpDocumentor 1.3.0RC3