<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6487.1">
<TITLE>Layer Status Problem</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hi there,</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">I'm currently attempting to create a really simple function as part of a widget with the following javascript code:</FONT></P>
<P><FONT SIZE=2 FACE="Arial"><script language="javascript"></FONT>
<BR><FONT SIZE=2 FACE="Arial"><!--</FONT>
<BR> <FONT SIZE=2 FACE="Arial">function enableLayer(i)</FONT>
<BR> <FONT SIZE=2 FACE="Arial">{</FONT>
<BR> <FONT SIZE=2 FACE="Arial">goCWCJSAPI.oMap.GetLayer(i).SetStatus("ON");</FONT>
<BR> <FONT SIZE=2 FACE="Arial">goCWCJSAPI.oMap.Refresh();</FONT>
<BR> <FONT SIZE=2 FACE="Arial">}</FONT>
<BR><FONT SIZE=2 FACE="Arial">//--></FONT>
<BR><FONT SIZE=2 FACE="Arial"></script></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">For any given layer x, the function is called as enableLayer(x), where 0<x<max number of layers. The problem I'm running into is that this code does not work correctly in the CWC2 application I'm using (Chameleon v1.0.5). Instead of enabling the layer and then refreshing the map, I get the 'loading … please wait' message, which lasts forever. I've checked for javascript errors and I get a message to the extent of 'document.body is empty'. Any suggestions would be greatly appreciated. </FONT></P>
<P ALIGN=CENTER><FONT SIZE=2 FACE="Arial">Steven D'Cruz</FONT></P>
<P ALIGN=CENTER><FONT SIZE=2 FACE="Arial">(Open)GIS Developer</FONT></P>
<P ALIGN=CENTER><FONT SIZE=2 FACE="Arial">Environment Canada</FONT></P>
<P ALIGN=CENTER><FONT SIZE=2 FACE="Arial">Steven.D'Cruz@ec.gc.ca</FONT></P>
</BODY>
</HTML>