LayerTreeExtra.js | |
Functions | |
mapfish. widgets. LayerTree. getNodeLayers | |
mapfish. widgets. LayerTree. removeNode | Remove all the OL layers from the map corresponding to a node. |
mapfish. widgets. createContextualMenuPlugin | Creates an EXT plugin that adds a contextual menu to the layer tree. |
mapfish. widgets. LayerTree. createDisableLayersPlugin | Creates an EXT plugin that allows to disable layers in the tree depending on current scale. |
Creates an EXT plugin that adds a contextual menu to the layer tree. On most browsers, this menu is shown when you right click a node. On Opera it’s displayed when you left click a node while holding SHIFT or CTRL.
Options can be added by adding them to mapfish.widgets.LayerTree.MenuFeatures
{ xtype: 'layertree', ... plugins: [ mapfish.widgets.LayerTree.createContextualMenuPlugin(['opacitySlide','remove']) ], ... }
options | {Array} array of features to include |
mapfish.widgets.LayerTree.createDisableLayersPlugin = function( serverResolution )
Creates an EXT plugin that allows to disable layers in the tree depending on current scale. Each node of tree can have options minScale and/or maxScale:
{ text: 'Layer', layerName: 'my_layer', maxScale: 50000000, minScale: 15000000, children: [ ...
{ xtype: 'layertree', ... plugins: [ mapfish.widgets.LayerTree.createDisableLayersPlugin(myMap) ], ... }
serverResolution | {Integer} mapfile resolution (in order to adjust scales) |
{Object} | EXT plugin |
mapfish.widgets.LayerTree.getNodeLayers = function( layerTree, node )
Remove all the OL layers from the map corresponding to a node.
mapfish.widgets.LayerTree.removeNode = function( layerTree, node )
Creates an EXT plugin that allows to disable layers in the tree depending on current scale.
mapfish.widgets.LayerTree.createDisableLayersPlugin = function( serverResolution )