Select to view content in your preferred language

Layer On/Off

814
3
02-08-2011 09:50 AM
MayJeff
Deactivated User
I would like to use the same button to turn on/off a layer instead of showing 2 buttons.  I attached the code below.  Please help.  Thank you.
Tags (2)
0 Kudos
3 Replies
EngemapGeoInformação
Emerging Contributor
0 Kudos
MitchKoyle
Deactivated User
If you want to toggle the the visibility for two layers, you could try using a visible flag and have each layer use that flag to toggle their visible property. Please note that this will work fine for two layers, but if you need to toggle the visibility for more than two layers, you might need something similar to the 'Switching Basemaps'  sample.

I have modified your file and attached it to show you what I mean.
0 Kudos
MayJeff
Deactivated User
Thank you very much.  It works 🙂
0 Kudos