<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>try</div><div><br></div><div>opacitySlider.setLayer(record.getLayer())</div><div><br></div><div>Best regards,</div><div>Bart</div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div>-- <br>Bart van den Eijnden<br>OSGIS - <a href="http://opengeo.org/">http://osgis.nl</a></div></div></div></div></span></div></span></div></span></div></span></div></span></span>
</div>
<br><div><div>On Aug 19, 2011, at 2:39 PM, Daniel Behr wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hello Everyone !<br><br>I'm having problems setting a new layer on the GeoExt LayerOpacitySlider <br>with its setLayer method.<br><br>I have a ComboBox configured like this:<br><br>***<br>layerComboBox = new Ext.form.ComboBox({<br> mode: "local",<br> store: new GeoExt.data.LayerStore({<br><span class="Apple-tab-span" style="white-space:pre">        </span>layers: getVisibleLayersArray()<br> }),<br> listeners: {<br><span class="Apple-tab-span" style="white-space:pre">        </span>scope: map, // or: this<br><span class="Apple-tab-span" style="white-space:pre">        </span>select: function(combo,record){<br> <span class="Apple-tab-span" style="white-space:pre">        </span> opacitySlider.setLayer(record.getLayer().params.ID)<br><span class="Apple-tab-span" style="white-space:pre">        </span> })<br><span class="Apple-tab-span" style="white-space:pre">        </span>}<br> },<br> displayField: 'title',<br> title: 'Transparency'<br>});<br>***<br><br>On the select event of this ComboBox I want to change the layer of this <br>opacitySlider:<br><br>***<br>var opacitySlider = new GeoExt.LayerOpacitySlider({<br> layer: null,<br> aggressive: true,<br> width: 150,<br> inverse: true,<br> plugins: new GeoExt.LayerOpacitySliderTip({<br> template: "<div>{opacity}% transparent</div>"<br> })<br>});<br>***<br><br>Both components work fine on their own and if I assign the setLayer() <br>method to the maps zoomend or some other event, the slider layer is <br>actually updated!<br><br>My guess is, that this is related to the GeoExt setLayer() function and <br>the scope it is executed in.<br>I did some trial and error, without success.<br><br>I hope someone can shed some light on this...<br><br>thanks in advance!<br>Daniel<br>Helmholtz-Zentrum Geesthacht <br>Zentrum für Material- und Küstenforschung GmbH <br>Max-Planck-Straße 1 I 21502 Geesthacht I Deutschland/Germany <br><br>Geschäftsführer/Board of Management: Prof. Dr. Wolfgang Kaysser, Dipl.-Ing. Michael Ganß <br>Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: MinDirig Wilfried Kraus <br>Amtsgericht Lübeck HRB 285 GE (Register Court) <br>Internet: <a href="http://www.hzg.de">http://www.hzg.de</a> <br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@geoext.org">Users@geoext.org</a><br>http://www.geoext.org/cgi-bin/mailman/listinfo/users<br></div></blockquote></div><br></div></body></html>