Skip to main content
Tweeted twitter.com/StackGIS/status/651932141996122113
Removed "Thanks" and signature as per help instructions
Source Link

In a Leaflet-based app I have create several overlays, grouped with leaflet.groupedlayercontrol.js, as shown in this image:

enter image description here

Everything works well, but I need to uncheck certain layers, allowing the user to check them if needed (the app should open with Heatmap and Geometries on, and the others off). I have references both to the layers and to the control object. How can I check/uncheck these overlays without removing them from the map object?

Thanks, Mulone

In a Leaflet-based app I have create several overlays, grouped with leaflet.groupedlayercontrol.js, as shown in this image:

enter image description here

Everything works well, but I need to uncheck certain layers, allowing the user to check them if needed (the app should open with Heatmap and Geometries on, and the others off). I have references both to the layers and to the control object. How can I check/uncheck these overlays without removing them from the map object?

Thanks, Mulone

In a Leaflet-based app I have create several overlays, grouped with leaflet.groupedlayercontrol.js, as shown in this image:

enter image description here

Everything works well, but I need to uncheck certain layers, allowing the user to check them if needed (the app should open with Heatmap and Geometries on, and the others off). I have references both to the layers and to the control object. How can I check/uncheck these overlays without removing them from the map object?

Source Link
Mulone
  • 147
  • 2
  • 6

Check/uncheck overlays in groupedlayercontrol.js

In a Leaflet-based app I have create several overlays, grouped with leaflet.groupedlayercontrol.js, as shown in this image:

enter image description here

Everything works well, but I need to uncheck certain layers, allowing the user to check them if needed (the app should open with Heatmap and Geometries on, and the others off). I have references both to the layers and to the control object. How can I check/uncheck these overlays without removing them from the map object?

Thanks, Mulone