Last active
August 29, 2015 13:58
-
-
Save brightrain/9982555 to your computer and use it in GitHub Desktop.
click event for toggling map layer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//click event for layers | |
//using dojo for the event and class toggling | |
//but could just as easily be jQuery or vanilla javascript | |
on(dojo.byId("trail"), "click", function() { | |
trailsLayer.visible ? trailsLayer.hide() : trailsLayer.show(); | |
dojo.toggleClass(this, "visible"); | |
dojo.query("#trail .visibility-icon") | |
.toggleClass("fa-picture-o") | |
.toggleClass("fa-ban"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment