<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="2">
<div>I am trying to display the minscale/maxscale of a specific layer as a tooltip when the user hoves over the legend item in the LayerNode. With the below code I am getting the tooltip properly but only on the very root of the tree item and not it's children.
Is there anyway to use the param variable so that I can put these tooltips on the childnodes instead.. As some of the min/max scales are different. I tried to use the layer.params but could not get it working. Appreciate any advice!</div>
<div> </div>
<div> </div>
<div><font face="Courier New"> <font color="#008000">//AOIs layerList</font></font></div>
<div><font face="Courier New"> layerList_AOIs = <font color="#0000FF">new</font> GeoExt.tree.LayerNode({</font></div>
<div><font face="Courier New"> <font color="#A31515">"layer"</font>: layer_AOIs,</font></div>
<div><font face="Courier New"> <font color="#A31515">"isLeaf"</font>: <font color="#0000FF">true</font>,</font></div>
<div><font face="Courier New"> <font color="#A31515">"preloadChildren"</font>: <font color="#0000FF">true</font>,</font></div>
<div><font face="Courier New"> <font color="#A31515">"checked"</font>: <font color="#0000FF">false</font>,</font></div>
<div><font face="Courier New"> <font color="#A31515">"enableDD"</font>: <font color="#0000FF">true</font>,</font></div>
<div><font face="Courier New"> <font color="#A31515">"cls"</font>: <font color="#A31515">"rootnode"</font>,</font></div>
<div><font face="Courier New"> <font color="#A31515">"qtip"</font>: layer_AOIs.maxScale + <font color="#A31515">':'</font> + layer_AOIs.minScale, //this works fine but need it for child nodes instead</font></div>
<div><font face="Courier New"> <font color="#A31515">"singleClickExpand"</font>: <font color="#0000FF">true</font>,</font></div>
<div><font face="Courier New"> <font color="#A31515">"listeners"</font>: </font></div>
<div><font face="Courier New"> {</font></div>
<div><font face="Courier New"> <font color="#A31515">'checkchange'</font> : <font color="#0000FF">function</font>(node, checked)</font></div>
<div><font face="Courier New"> {</font></div>
<div><font face="Courier New"> <font color="#008000">// If a parent node is unchecked, uncheck all the children</font></font></div>
<div><font face="Courier New"> <font color="#0000FF">if</font> (node.getUI().isChecked()) {</font></div>
<div><font face="Courier New"> node.expand();</font></div>
<div><font face="Courier New"> }</font></div>
<div><font face="Courier New"> <font color="#0000FF">if</font> (!node.getUI().isChecked()) {</font></div>
<div><font face="Courier New"> node.collapse();</font></div>
<div><font face="Courier New"> }</font></div>
<div><font face="Courier New"> },</font></div>
<div><font face="Courier New"> <font color="#A31515">'load'</font> : <font color="#0000FF">function</font>(e) {</font></div>
<div><font face="Courier New"> <font color="#0000FF">if</font> (bool_aois == <font color="#0000FF">false</font>)</font></div>
<div><font face="Courier New"> {</font></div>
<div><font face="Courier New"> <font color="#008000">//change icon of childNodes to GetLegendGraphic from WMS + node text attribute</font></font></div>
<div><font face="Courier New"> <font color="#0000FF">var</font> count = (e.childNodes.length -1);</font></div>
<div><font face="Courier New"> <font color="#0000FF">while</font> (count >= 0)</font></div>
<div><font face="Courier New"> {</font></div>
<div><font face="Courier New"> <font color="#0000FF">var</font> label = e.childNodes[count].text; </font></div>
<div><font face="Courier New"> <font color="#0000FF">var</font> fixed_label = label.replace(/_/g,<font color="#A31515">' '</font>);</font></div>
<div><font face="Courier New"> e.childNodes[count].setText(<font color="#A31515">"<img src='http://localhost/WebServices/Request.aspx?request=GetLegendGraphic&version=1.1.1&format=image/png&style=&layer="</font>+label + <font color="#A31515">"'/>"</font>
+ <font color="#A31515">' '</font> +fixed_label);</font></div>
<div><font face="Courier New"> count -=1;</font></div>
<div><font face="Courier New"> }</font></div>
<div><font face="Courier New"> bool_aois = <font color="#0000FF">true</font>;</font></div>
<div><font face="Courier New"> }</font></div>
<div><font face="Courier New"> <font color="#0000FF">else</font></font></div>
<div><font face="Courier New"> {</font></div>
<div><font face="Courier New"> <font color="#008000">//do nothing</font></font></div>
<div><font face="Courier New"> }</font></div>
<div><font face="Courier New"> } </font></div>
<div><font face="Courier New"> },</font></div>
<div><font face="Courier New"> <font color="#A31515">"loader"</font>: {</font></div>
<div><font face="Courier New"> <font color="#A31515">"param"</font>: <font color="#A31515">"LAYERS"</font></font></div>
<div><font face="Courier New"> }</font></div>
<div><font face="Courier New"> });</font></div>
<div><font face="Courier New"> </font></div>
<div><font face="Courier New">And my actual layer is declared like so -</font></div>
<div><font face="Courier New"> </font></div>
<div><font face="Courier New"> <font color="#008000">//Areas of Interest Group</font></font></div>
<div><font face="Courier New"> <font color="#0000FF">var</font> layer_AOIs = <font color="#0000FF">new</font> OpenLayers.Layer.WMS(<font color="#A31515">"Areas of Interest"</font>, <font color="#A31515">"</font><a href="http://localhost/WebServices/Request.aspx"><font color="#0000FF"><u>http://localhost/WebServices/Request.aspx</u></font></a><font color="#A31515">"</font>,
</font></div>
<div><font face="Courier New"> {</font></div>
<div><font face="Courier New"> layers: [<font color="#A31515">'Community_Shelter'</font>, <font color="#A31515">'Hotel_Motel'</font>, <font color="#A31515">'Library'</font>, <font color="#A31515">'Museum'</font>, <font color="#A31515">'Theatre'</font>,
<font color="#A31515">'Place_of_Worship'</font>, <font color="#A31515">'Parking'</font>, <font color="#A31515">'City_Facility'</font>, <font color="#A31515">'Recreation'</font>, <font color="#A31515">'School_Age_Program'</font>, <font color="#A31515">'School'</font>
, <font color="#A31515">'Major_Commercial_Centre'</font> , <font color="#A31515">'Hospital'</font> , <font color="#A31515">'Police_Station'</font> , <font color="#A31515">'Fire_Hall'</font> , <font color="#A31515">'Attraction'</font>],</font></div>
<div><font face="Courier New"> VERSION: <font color="#A31515">"1.1.1"</font>,</font></div>
<div><font face="Courier New"> transparent: <font color="#0000FF">true</font></font></div>
<div><font face="Courier New"> },</font></div>
<div><font face="Courier New"> { isBaseLayer: <font color="#0000FF">false</font>,</font></div>
<div><font face="Courier New"> singleTile: <font color="#0000FF">true</font>,</font></div>
<div><font face="Courier New"> visibility: <font color="#0000FF">false</font>,</font></div>
<div><font face="Courier New"> buffer: 1,</font></div>
<div><font face="Courier New"> ratio: 1</font></div>
<div><font face="Courier New"> }</font></div>
<div><font face="Courier New"> );</font></div>
<div><font face="Courier New"> </font></div>
<div> </div>
</font>
<DIV><P><HR>
This e-mail is intended for the original recipient(s) only. If you have received it in error, please advise the sender and delete this message.
</P></DIV>
</body>
</html>