I add some geojson layers to the map control once a layer is loaded and the control can show all the layer names. But I notice that all the checkboxes are unchecked by default. So that once I click the control to uncollapse it, all the layers disappear. And I have to check them one by one to display them again.
The code is like:
ctrl = L.control.layers([aBaseLayer]); ctrl.addOverlay(aGeoJsonLayer, 'ageojsonlayer');
Then I can control the aGeoJsonLayer, but unlike the aBaseLayer, the aGeoJsonLayer is not checked by default in the control panel. So every time after the layer is loaded, when I click the control, the layer will be gone until I check it in the control panel. Any way to fix this?