Closed rychu83 closed 8 years ago
I got a working example here if you want to take a look at the source
hi
very nice map and made fun ; ) unfortunately I can not add
var Bla = new OpenLayers.Layer.WMS("Bla",
if I add VAR page does not open ; /
if you want to append a layer in the tree you do it like this. Sorry but I cannot understand what you want to do
var opmap= new OpenLayers.Layer.WMS(
displayname, geoserverWmsDefaults.wmsUrl,
{
LAYERS: layername,
STYLES: layerstyle,
format: 'image/png',
transparent: true
},
{
buffer: 0,
displayOutsideMaxExtent: true,
isBaseLayer: false,
visibility: false
}
);
var treeNode = tree.getRootNode();
treeNode.getChildAt(0).appendChild({
text: opmap.name,
layer: opmap,
leaf: true,
checked: false,
children: [],
nodeType: "gx_overlaylayercontainer"
});
Hey Thank you for your interest and for your help and sorry for possible weak explanation unfortunately I am a novice on the high seas ; ) I you trying to create a menu tree as below here , perhaps more clearly the main levels there will be the base layer ( 2-5 maps) and several layers such as 2015 and 2016 other and below each of them a few more choices. Launched by the way you unfortunately did not work something wrong maybe I changed my code ; / you can help to advance our example.
Regards Lukas
var store = Ext.create('Ext.data.TreeStore', {
model: 'GeoExt.data.LayerTreeModel',
root: {
expanded: true,
children: [ {
plugins: ['gx_baselayercontainer'],
expanded: true,
text: "Wybór Mapy Podkładowej"
}, {
text: "2016",
expanded: false,
checked: false,
children: [
{ text: "Styczeń", expanded: false, checked: false,
children: [
{ text: "1.1", leaf: true, expanded: true, checked: false},
{ text: "2.1", leaf: true, expanded: true, checked: false},
{ text: "3.1", leaf: true, expanded: true, checked: false},
{ text: "4.1", leaf: true, expanded: true, checked: false},
{ text: "5.1", leaf: true, expanded: true, checked: false},
{ text: "6.1", leaf: true, expanded: true, checked: false},
{ text: "7.1", leaf: true, expanded: true, checked: false},
] },
{ text: "Luty", expanded: false, checked: false,
children: [
{ text: "1.2", leaf: true, expanded: true, checked: false},
{ text: "2.2", leaf: true, expanded: true, checked: false},
{ text: "3.2", leaf: true, expanded: true, checked: false},
{ text: "4.2", leaf: true, expanded: true, checked: false},
{ text: "5.2", leaf: true, expanded: true, checked: false},
{ text: "6.2", leaf: true, expanded: true, checked: false},
{ text: "7.2", leaf: true, expanded: true, checked: false},
] },
{ text: "Marzec", expanded: false, checked: false,
children: [
{ text: "1.3", leaf: true, expanded: true, checked: false},
{ text: "2.3", leaf: true, expanded: true, checked: false},
{ text: "3.3", leaf: true, expanded: true, checked: false},
{ text: "4.3", leaf: true, expanded: true, checked: false},
{ text: "5.3", leaf: true, expanded: true, checked: false},
{ text: "6.3", leaf: true, expanded: true, checked: false},
{ text: "7.3", leaf: true, expanded: true, checked: false},
] },
]),
{
text: "2015",
expanded: false,
checked: false,
children: [
{ text: "Styczeń", expanded: false, checked: false,
children: [
{ text: "1.1", leaf: true, expanded: true, checked: false},
{ text: "2.1", leaf: true, expanded: true, checked: false},
{ text: "3.1", leaf: true, expanded: true, checked: false},
{ text: "4.1", leaf: true, expanded: true, checked: false},
{ text: "5.1", leaf: true, expanded: true, checked: false},
{ text: "6.1", leaf: true, expanded: true, checked: false},
{ text: "7.1", leaf: true, expanded: true, checked: false},
] },
{ text: "Luty", expanded: false, checked: false,
children: [
{ text: "1.2", leaf: true, expanded: true, checked: false},
{ text: "2.2", leaf: true, expanded: true, checked: false},
{ text: "3.2", leaf: true, expanded: true, checked: false},
{ text: "4.2", leaf: true, expanded: true, checked: false},
{ text: "5.2", leaf: true, expanded: true, checked: false},
{ text: "6.2", leaf: true, expanded: true, checked: false},
{ text: "7.2", leaf: true, expanded: true, checked: false},
] },
{ text: "Marzec", expanded: false, checked: false,
children: [
{ text: "1.3", leaf: true, expanded: true, checked: false},
{ text: "2.3", leaf: true, expanded: true, checked: false},
{ text: "3.3", leaf: true, expanded: true, checked: false},
{ text: "4.3", leaf: true, expanded: true, checked: false},
{ text: "5.3", leaf: true, expanded: true, checked: false},
{ text: "6.3", leaf: true, expanded: true, checked: false},
{ text: "7.3", leaf: true, expanded: true, checked: false},
] },
@rychu83, please point questions about the usage of the library to the GeoExt mailing list or Stack Overflow. GitHub Issues are used for bug tracking only.
If you think your problem is due to a bug in GeoExt, feel free to reopen or post a new issue. Thanks.
@elasticrash as you mentioned about appending a layer in tree in above comments I've a question. What if we want to have a WMS legend for that layer in the layer tree. Do we need to explicitly mention it in the store and mention it with the child node
HI
I the build applications with geoext 2 opengeo apartment and I'm trying to create a tree layer with some "grouped" layers , as the last node here I saw somewhere that you should set the node type to " gx_layer " to get the desired effect . Unfortunately, inaction and even though the tree has a form of what I want but it does not work ; / PLEASE HELP This is my code: