style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">Hi,
I need to know how to do the following in javascript (webpage) :
A mwf
contains for example 4 layers and if the user switch on one layer from the
legend it displays on the map, if he selects another layer from the legend the
first layer must switch off and only the second layer must show on the map. I
want to do this in the onViewChanged function in javascript?
Thanks,
Sonja
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"cszb" <
href="mailto:zsigmond_balogh@city.vancouver.bc.ca">zsigmond_balogh@city.vancouver.bc.ca>
wrote in message
href="news:BDB0980347AE6302CDB1F6EEA5705996@in.WebX.maYIadrTaRb">news:BDB0980347AE6302CDB1F6EEA57......
Yes, I would use the onViewChanged event and
create a toggle statement something like:
var
Layer1=map.getMapLayer("Layer-A");
var
Layer2=map.getMapLayer("Layer-B");
if (Layer1.getVisibility())
//is true
{
Layer2.setVisibility(true);
}
else if (Layer2.getVisibility()) //is true
{
Layer1.setVisibility(false);
}
Good
luck
ZB
"Sonja" <
href="mailto:sbeukes@openspatial.co.za">sbeukes@openspatial.co.za>
wrote in message
href="news:f19bfb5.-1@WebX.maYIadrTaRb">news:f19bfb5.-1@WebX.maYIadrTaRb...
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">Hi,
I need to know how to do the following in javascript (webpage) :
A
mwf contains for example 4 layers and if the user switch on one layer from
the legend it displays on the map, if he selects another layer from the
legend the first layer must switch off and only the second layer must show
on the map. I want to do this in the onViewChanged function in javascript?
Thanks,
Sonja