source:
trunk/workshop-routing-foss4g/web/GeoExt/lib/GeoExt/widgets/tree/OverlayLayerContainer.js
@
76
Revision 76, 1.6 KB checked in by djay, 12 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | /** |
2 | * Copyright (c) 2008-2010 The Open Source Geospatial Foundation |
3 | * |
4 | * Published under the BSD license. |
5 | * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text |
6 | * of the license. |
7 | */ |
8 | |
9 | /** |
10 | * @requires GeoExt/widgets/tree/LayerContainer.js |
11 | */ |
12 | Ext.namespace("GeoExt.tree"); |
13 | |
14 | /** api: (define) |
15 | * module = GeoExt.tree |
16 | * class = OverlayLayerContainer |
17 | */ |
18 | |
19 | /** api: (extends) |
20 | * GeoExt/widgets/tree/LayerContainer.js |
21 | */ |
22 | |
23 | /** api: constructor |
24 | * .. class:: OverlayLayerContainer |
25 | * |
26 | * A layer container that will collect all overlay layers of an OpenLayers |
27 | * map. Only layers that have displayInLayerSwitcher set to true will be |
28 | * included. |
29 | * |
30 | * To use this node type in ``TreePanel`` config, set nodeType to |
31 | * "gx_overlaylayercontainer". |
32 | */ |
33 | GeoExt.tree.OverlayLayerContainer = Ext.extend(GeoExt.tree.LayerContainer, { |
34 | |
35 | /** private: method[constructor] |
36 | * Private constructor override. |
37 | */ |
38 | constructor: function(config) { |
39 | config = Ext.applyIf(config || {}, { |
40 | text: "Overlays" |
41 | }); |
42 | config.loader = Ext.applyIf(config.loader || {}, { |
43 | filter: function(record){ |
44 | var layer = record.getLayer(); |
45 | return layer.displayInLayerSwitcher === true && |
46 | layer.isBaseLayer === false; |
47 | } |
48 | }); |
49 | |
50 | GeoExt.tree.OverlayLayerContainer.superclass.constructor.call(this, |
51 | config); |
52 | } |
53 | }); |
54 | |
55 | /** |
56 | * NodeType: gx_overlaylayercontainer |
57 | */ |
58 | Ext.tree.TreePanel.nodeTypes.gx_overlaylayercontainer = GeoExt.tree.OverlayLayerContainer; |
Note: See TracBrowser
for help on using the repository browser.