Hello everyone
In my test page
https://visiolittoral.fr/ANDROID_CAR...=46.15&ZOOM=12 I use several LeafLet features.
Among others, the ability to display geoJson data (lines 156 to 247).
The principle is to display geoJson data from three URLs that return the same geoJson structure.
In the geoJson, if the "typeloc" property starts with a "G", I do not want to display the layer but I want it to be present in the layerswitcher for on-demand display (Lines 228 to 231).
In the current version of the code, I start with an addTo(map) for all layers, the addition in the layerswitcher, then for the 'G', I remove the layer from the map. I tried simply not to do the addTo for the 'G', but that doesn't change the problem that I'm explaining to you now.
On the first display, the geoJson data other than the 'G' (Commune and neighboring commune) are displayed correctly. To display the 'G', you must in theory open the LayerSwitcher, uncheck the "eye" to display the map.
That's the problem!
On the first display, the "eye" of the "G" is "open in the layerSwitcher which means that the layer is displayed on the map, and this is not the case of course.
To find a perfect synchronization between map and layerswitcher, you have to click twice on the "eye", once to close it, once to open it.
There you go, since you didn't know what to do, I found you something to do!
Kind regards
Pascal
Phase 1
Phase 2

Phase 3
