[Users] Slider opacity right mouse click

Phil Scadden p.scadden at gns.cri.nz
Mon Oct 3 23:01:15 CEST 2011


> In mapfish applications it was the possibility to get an slider 
> control to change opacity in layer tree, just right click over layer 
> name's. This bahaviour is very interesting for me, but i'm not idea 
> how can I reproduce it in geoext 1.0 application.
>
>
I added it to the layertreebuilder ux (Alexander Dube excellent 
creation) using the contextmenuplugin,
viz this edit to 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());
         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;
     },

See http://kite.gns.cri.nz/PBE/index.html#MAP:OPAConfig.json for example 
in action.

Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20111004/0bb7a5f3/attachment.htm 


More information about the Users mailing list