Select to view content in your preferred language

Toggle layers with checkboxes

4024
11
Jump to solution
07-10-2014 07:53 AM
DonaldLund
New Contributor II

How would you code the javascript to initialize a map with 4 layers if you want 2 layers to be initially visible when the map loads, and 2 layers to be hidden, and you want the ability to toggle the layers on and off in any combination using checkboxes. Would prefer the check boxes to be in a dojo accordion panel, but would settle for them being across the top if that is easier.

0 Kudos
11 Replies
YungKaiChin
Occasional Contributor

You could just use built-in method:

street.show();

or

street.hide();

0 Kudos
DonaldLund
New Contributor II

I'll give it a try. Thanks.

0 Kudos