0
votes

I have a mapbox map with a layer toggler just like the one seen in the link here (https://www.mapbox.com/mapbox.js/example/v1.0.0/layers/).

It works great, but I need a solution to default some of the layers to show off or inactive upon initial map load.

Thank you!

1

1 Answers

0
votes

A possibly hacky solution would be to add return link; to the end of addLayer, and when you call addLayer for the layer you want toggled off, just add a .click() to the end of it to toggle it off immediately.