HSLayers.Layer.TreeLayer (class)

HSLayers.Layer.TreeLayer

class HSLayers.Layer.TreeLayer()

It is special type of OpenLayers.Layer.MapServer which mirrors content of of the mapfile in the layerswitcher. Advantage: one physical layer in the map, but many tree nodes within the layerswitcher.

The layer will (when added to map) download list of available layers and groups from the server. The request will be automatically send to the server with mode set to lyrlist

http://server/script?...&mode=lyrlist&...

Example usage:

var l = new HSLayers.Layer.TreeLayer("name",
        "/mapserv/index.php",
        {
            transparent: true,
            layers: "layer1 layer2" // default turned-on
        },
        {
            visibility: true,
         ratio: 1,
            isBaseLayer: false,
            queryable: true
    });
see:OpenLayers.Layer.MapServer

Properties

HSLayers.Layer.TreeLayer.baseGroup
Type :[HSLayers.TreeLayer.Group] (static)

HSLayers.Layer.TreeLayer

base group

HSLayers.Layer.TreeLayer.loadingTree
Type :Boolean (static)

HSLayers.Layer.TreeLayer

Indicates, if the tree of layers is being loaded right now or not

HSLayers.Layer.TreeLayer.singletTile
Type :Boolean (static)

HSLayers.Layer.TreeLayer

singletTile is false by defult

Methods

so that subclasses can override this and take special action once they have their map variable set. Here we take care to bring over any of the necessary default properties from the map.

HSLayers.Layer.TreeLayer.setMap()
Set the map property for the layer. This is done through an accessor

so that subclasses can override this and take special action once they have their map variable set. Here we take care to bring over any of the necessary default properties from the map.

param `OpenLayers.Map:
 <http>`_ map
HSLayers.Layer.TreeLayer.bubble(fnc, scope, {Mixed})

bubble objects up function

Arguments:
  • fnc (Function) –
  • scope (Object) – optional, default is this group
  • {Mixed}

    args optional

    Optional

HSLayers.Layer.TreeLayer.saltURL(url)

Add salt&paper parameter to given URL

Arguments:
HSLayers.Layer.TreeLayer.getFullRequestString(newParams, altUrl)

combine the layer’s url with its params and these newParams.

Arguments:
  • newParams (Object) – New parameters that should be added to the request string.
  • altUrl (String) – (optional) Replace the URL in the full request string with the provided URL.
Returns:

A string with the layer’s url and parameters embedded in it.

Return type:

String

HSLayers.Layer.TreeLayer.getLayer(name)

Get Layer object by given name

Arguments:
Returns:

HSLayers.Layer.TreeLayer.Layer()

HSLayers.Layer.TreeLayer.getVisibleLayers()

returns list of visible sublayers

Returns:[HSLayers.Layer.TreeLayer.Layer]
HSLayers.Layer.TreeLayer.setLayerVisibility(name, visibility, redraw)

set sub layer visibility

Arguments:
  • name (String) –
  • visibility (Boolean) –
  • redraw (Boolean) –

Events

layerloaded
indicates, that the layer tree is loaded
layerloadend
indicates, that the layer tree is loaded
loadcancel
loading finished
loadend
indicates, that the layer tree is loaded
loadfail
something went wrong
loadstart
we are starting to load the layer
visibilitychanged
inidicates change of visibility

Main Menu


Table Of Contents

Previous topic

HSLayers.Layer.SearchParser (class)

Next topic

HSLayers.Layer.TreeLayer.Group (class)

This Page