[Users] OpacitySlider for each Layer in a LayerTree(LayerTreeBuilder)
Morper-Busch, Lucia
Lucia.Morper-Busch at sbg.ac.at
Wed Mar 30 12:01:49 CEST 2011
Hello GeoExt users,
after long searching for a solution I found the OpacitySliderPlugin, now renamed to ContextMenuPlugin to integrate into the LayerTree.
I inserted the ContextMenuPlugin with a LayerOpacitySliderTip-Plugin in the LayerTreeBuilder.js and now it does what I want:
Code snippet of LayerTreeBuilder.js:
initComponent: function(){
this.addEvents(this.CUSTOM_EVENTS);
this.plugins = this.plugins || [];
this.plugins.push({ptype: "gx_treenodecomponent"});
this.plugins.push(new GeoExt.ux.plugins.LayerTreeBuilderNodeAgent());
//Context menu with opacity slider, added by Lucia:
this.plugins.push(new GeoExt.tree.ContextMenuPlugin({
sliderOptions:{
aggressive: true,
plugins: new GeoExt.LayerOpacitySliderTip()
}
})
);
GeoExt.ux.tree.LayerTreeBuilder.superclass.initComponent.call(this);
if(!this.layerStore) {
this.layerStore = GeoExt.MapPanel.guess().layers;
}
this.layerStore.on({
"add": this.onLayerAdded,
"remove": this.onLayerRemoved,
scope: this
});
this.layerStore.treeBuilder = this;
},
Three remarks:
1. It's hard to find new developments. I'm searching always with key words like "opacity slider" "layertree" and similar. In my opinion there is a lack of finding the latest improvements. The code examples are not linked to these key words, isn't it?
2.It would be nice for a boolean option of the LayerTreeBuilder to set "ContextMenu: true/false", without manipulating the code of the LayerTreeBuilder.js itself. Maybe also with SliderOptions for a possible integrating of the very useful LayerOpacitySliderTip.
3. There is a Error executing the new code: "this.dom.style is null or not an object" referring to ext-all.js.
Does anybody know how to fix it?
Thanks
Lucia
Dipl.-Geogr. Lucia Morper-Busch | Researcher
University of Salzburg | Centre for Geoinformatics - Z_GIS
Schillerstr.30 | Techno-Z, Block 15, 3rd floor | 5020 Salzburg, Austria
Phone +43 (0)662 8044 5298 | Fax +43 (0)662 8044 5260
> Z_GIS...experts for the spatial view <http://www.zgis.at/research>
Von: users-bounces at geoext.org [mailto:users-bounces at geoext.org] Im Auftrag von Morper-Busch, Lucia
Gesendet: Dienstag, 29. März 2011 15:06
An: users at geoext.org
Betreff: [Users] OpacitySlider for each Layer in a LayerTree(LayerTreeBuilder)
Hi GeoExt users,
I have a second question:
Do anybody know how to combine LayerTreeBuilder with a OpacitySlider for each visible layer in the tree?
I managed only either legend or OpacitySlider, but I want both!
Thank you
Lucia
Dipl.-Geogr. Lucia Morper-Busch | Researcher
University of Salzburg | Centre for Geoinformatics - Z_GIS
Schillerstr.30 | Techno-Z, Block 15, 3rd floor | 5020 Salzburg, Austria
Phone +43 (0)662 8044 5298 | Fax +43 (0)662 8044 5260
> Z_GIS...experts for the spatial view <http://www.zgis.at/research>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110330/7d4424d1/attachment.htm
More information about the Users
mailing list