<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:8pt">Hi,<br><br>I am trying to write a function which checks to see if a layer is present in the tree.<br><br>if the layer already exists in the tree (or map) is shouldn´t be loaded...<br><br><br>can anyone help?<br><br><div>var clonename = clone.get("layer").name<br> <br> if (mapPanel.layers(clonename)) {<br> Ext.MessageBox.alert(null, "test");<br> }<br> else <br> {<br>
mapPanel.layers.add(clone);<br> Ext.MessageBox.alert(null, clonename);<br> }<br><br>Cheers<br>Rob<br></div>
</div><br></body></html>