[Chameleon] Chameleon 2.6 RC1
Normand Savard
nsavard at mapgears.com
Fri Sep 7 13:59:51 EDT 2007
Nolte, Tim wrote:
>One issue with the current 2.6rc1 I just realized is that there seems to
>be a problem with the UpdateMap widget when running under JSAPI mode.
>Anyone got any thoughts?
>
>
Tim,
Can you describe a little bit more the problem you encountered? Don't
forget to make the UpdateMap aware of a change in the legend you need to
add a JavaScript function call in legend_template.html file.
Norm
legend_template:
[leg_layer_html order=ascending opt_flag=15]
<tr bgcolor="#ffffff">
<td><input type="radio" name="my_legend"
onclick="CWCSelectLayer('[leg_layer_name]', true)"[if name=selected
value=1] CHECKED[/if] ></td>
<td align="center" width=20><input type="checkbox"
name="legendlayername[]"
value="[leg_layer_name]" onclick="ChangeLayerStatus('[leg_layer_name]')"
[if name=layer_status oper=eq value=1]CHECKED[/if]
[if name=layer_status oper=eq value=2]CHECKED[/if]></td>
<td><img src="[leg_icon width=20 height=18]" width="20" height="20"</td>
[if name=wms_name oper=isnull]
<td><a href="#"
onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span
class="label">[leg_layer_name]</span></a></td>
</tr>
[/if]
[if name=wms_name oper=isset]
<td><a href="#"
onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span
class="label">[metadata name=WMS_TITLE]</span></a></td>
</tr>
[/if]
[/leg_layer_html]
----------------
function ChangeLayerStatus(szLayerName)
{
alert('ChangeLayerStatus');
if(typeof goCWCJSAPI == "undefined")
{
return false;
}
szStatus = goCWCJSAPI.oMap.GetLayerByName(szLayerName).GetStatus();
//alert('status='+szStatus)
if(szStatus == "ON")
{
szNewStatus = "OFF";
}
else
{
szNewStatus = "ON";
}
goCWCJSAPI.oMap.GetLayerByName(szLayerName).SetStatus(szNewStatus);
szStatus = goCWCJSAPI.oMap.GetLayerByName(szLayerName).GetStatus();
//alert('status='+szStatus)
}
More information about the Chameleon
mailing list