<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<style type="text/css">
/*<![CDATA[*/
p {margin:0;padding:0;}
/*]]>*/
</style>
<title></title>
</head>
<body style="font-family:verdana,geneva,sans-serif;font-size:12px;color:#000;">
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;">Hello Dave,</span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;">I'm sorry, I misunderstood your initial question.</span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;">I'm dealing with a layers container, so I built a plugin for a layergroup node that holds OpenLayers.Layer instances.</span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;">I'm not using the "layers" param of OpenLayers.Layer as in LayerParamLoader</span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<p style="padding:0;margin:0">&nbsp;</p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;">However, h</span></span><span style="font-family: verdana, geneva, sans-serif;">ere's the code</span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<p style="padding:0;margin:0">&nbsp;</p>
<p style="padding:0;margin:0">/**<br />
* The LayerFolder plugin. This is used to create a node that holds multiple layers, keeping checkboxes syncd<br />
* {plugins: ['gx_layerfolder'], ...}<br />
*<br />
*/<br />
Ext.define('GeoExt.tree.LayerFolderNode', {<br />
extend: 'Ext.AbstractPlugin',<br />
alias: 'plugin.gx_layerfolder',</p>
<p style="padding:0;margin:0">&nbsp;</p>
<p style="padding:0;margin:0">init: function(target) {<br />
var me = this,<br />
checked = true,<br />
layer;<br />
<br />
target.eachChild(function(node) {<br />
layer = node.get('layer');<br />
if(!layer.getVisibility()) checked = false;<br />
layer.events.on({<br />
'visibilitychanged' : me.onChildLayerVisibilityChanged,<br />
scope: me<br />
});<br />
});<br />
target.set('checked', checked);<br />
<br />
target.on('afteredit', function(node, modifiedFields) {<br />
if(~Ext.Array.indexOf(modifiedFields, 'checked')) {<br />
me.onCheckChange();<br />
}<br />
});<br />
<br />
me.target = target;<br />
},</p>
<p style="padding:0;margin:0">&nbsp;</p>
<p style="padding:0;margin:0">/**<br />
* @private<br />
* Updates the visibility of the child layers<br />
* node.<br />
*/<br />
onCheckChange: function() {<br />
var node = this.target,<br />
checked = this.target.get('checked');</p>
<p style="padding:0;margin:0">&nbsp;</p>
<p style="padding:0;margin:0">if(!node._visibilityChanging) return;<br />
<br />
node._visibilityChanging = true;<br />
node.eachChild(function(node) {<br />
node.get('layer').setVisibility(checked);<br />
});<br />
delete node._visibilityChanging;<br />
},<br />
<br />
/**<br />
* @private<br />
* Updates the visibility this node, when children visibility changes<br />
*<br />
*/<br />
onChildLayerVisibilityChanged: function() {<br />
var node = this.target;<br />
<br />
if(!node._visibilityChanging) return;<br />
<br />
var checked = true;<br />
node.eachChild(function(childNode) {<br />
if(!childNode.get('layer').getVisibility()) checked = false;<br />
});<br />
node._visibilityChanging = true;<br />
node.set('checked', checked);<br />
delete node._visibilityChanging;<br />
}</p>
<p style="padding:0;margin:0">&nbsp;</p>
<p style="padding:0;margin:0">});</p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;">Francesco</span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<p style="padding:0;margin:0"><span style="font-family: verdana, geneva, sans-serif;">-------Dave Kliphon &lt;davek@SCA-CORP.COM&gt; wrote--------</span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;">Subject: RE: [Users] GeoExt2 Sublayer Example?</span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;">Date: 19.02.2013 21:39</span></span></p>
<p style="padding:0;margin:0"><span style="font-size: 12px;"><span style="font-family: verdana,geneva,sans-serif;"><br /></span></span></p>
<blockquote style="border-left: 2px solid #00F; margin: 0 0 0 10px; padding: 0 0 0 5px;">
<div class="WordSection1">
<p class="MsoNormal"><span style="color: #1f497d;">Francesco,</span></p>
<p class="MsoNormal"><span style="color: #1f497d;">&nbsp;</span></p>
<p class="MsoNormal"><span style="color: #1f497d;">It seems that we would need to develop both layer node group and group loader classes, similar to the LayerParamNode and LayerParamLoader scripts in v1.1.&nbsp; Pass along any code examples if you have them, otherwise we will follow your lead in developing this custom sub-layer capability.</span></p>
<p class="MsoNormal"><span style="color: #1f497d;">&nbsp;</span></p>
<p class="MsoNormal"><span style="color: #1f497d;">Do you or does anyone know if the sub-layer feature will ultimately be revived in GeoExt2, and is there a GeoExt2 release date?</span></p>
<p class="MsoNormal"><span style="color: #1f497d;">&nbsp;</span></p>
<p class="MsoNormal"><span style="color: #1f497d;">Thanks for your help,</span></p>
<p class="MsoNormal"><span style="color: #1f497d;">&nbsp;</span></p>
<p class="MsoNormal"><span style="color: #1f497d;">Dave</span></p>
<p class="MsoNormal"><span style="color: #1f497d;">&nbsp;</span></p>
<div>
<div style="border: none; border-top: solid #B5C4DF 1.0pt; padding: 3.0pt 0in 0in 0in;">
<p class="MsoNormal"><strong><span style="font-size: 10.0pt; font-family: 'Tahoma','sans-serif'; color: windowtext;">From:</span></strong> <span style="font-size: 10.0pt; font-family: 'Tahoma','sans-serif'; color: windowtext;">Francesco D'Alesio [mailto:francesco.dalesio@r3-gis.com]<br />
<strong>Sent:</strong> Tuesday, February 19, 2013 2:00 AM<br />
<strong>To:</strong> Dave Kliphon<br />
<strong>Cc:</strong> users@geoext.org<br />
<strong>Subject:</strong> Re: [Users] GeoExt2 Sublayer Example?</span></p>
</div>
</div>
<p class="MsoNormal">&nbsp;</p>
<div>
<p class="MsoNormal">Hello Dave,<br />
I've defined a layegroup plugin, similar to GeoExt.tree.LayerNode , that simply get "checked" from children and pass the "check change" event to children.<br />
<br />
<br />
Francesco<br />
<br />
<br />
Il 18/02/2013 22:59, Dave Kliphon ha scritto:</p>
</div>
<blockquote style="margin-top: 5.0pt; margin-bottom: 5.0pt;">
<p class="MsoNormal">Does anyone have an example of sublayer creation in GeoExt2?&nbsp; It appears that examples/tree/tree.js is incomplete in this respect (the Tasmanian Group Layer is a single tier, unlike in 1.1).</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">If there are no examples, is there a timeframe for release, or advice on developing a temporary solution?</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Thanks!</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Dave</p>
<p class="MsoNormal"><span style="font-size: 12.0pt; font-family: 'Times New Roman','serif';"><br />
<br />
<br /></span></p>
<pre>
_______________________________________________
</pre>
<pre>
Users mailing list
</pre>
<pre>
<a href="mailto:Users@geoext.org">Users@geoext.org</a>
</pre>
<pre>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a>
</pre></blockquote>
<p class="MsoNormal" style="margin-bottom: 12.0pt;"><span style="font-size: 12.0pt; font-family: 'Times New Roman','serif';">&nbsp;</span></p>
<div>
<p class="MsoNormal"><span style="font-size: 12.0pt; font-family: 'Times New Roman','serif';">--</span></p>
<div>
<p class="MsoNormal"><span style="font-size: 12.0pt; font-family: 'Times New Roman','serif';">&nbsp;</span></p>
</div>
</div>
</div>
</blockquote>
</body>
</html>