You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling removeLayer() to remove a base layer (last one displayed in group layer control) and then calling addBaseLayer() to readd the layer; the grouplayer control only displays base layers and cannot display the group layer options.
It appears that html controls are being appended/added again/duplicated in the _domGroups[0].innerHTML
Updating the following two functions appears to fix this:
A similar bug was recently reported and their pull request should have fixed this issue as well. Try the latest code out and let me know if it solves your issue.
if the fix was the recent change submitted by blomm then that isnt the fix for the issue I have raised above (blomm and I are working on the same project)
I can confirm that these two lines of code are necessary if you are adding/removing layers to the layer control after the layer control has initially been built. The two lines of code are made necessary because of the unique way the overlay container is built taking groups into consideration
When calling removeLayer() to remove a base layer (last one displayed in group layer control) and then calling addBaseLayer() to readd the layer; the grouplayer control only displays base layers and cannot display the group layer options.
It appears that html controls are being appended/added again/duplicated in the _domGroups[0].innerHTML
Updating the following two functions appears to fix this:
addBaseLayer: function (layer, name) {
this._addLayer(layer, name);
/Start inserted code/
this._domGroups.length = 0;
/End inserted code/
this._update();
return this;
},
addOverlay: function (layer, name, group) {
this._addLayer(layer, name, group, true);
/Start inserted code/
this._domGroups.length = 0;
/End inserted code/
this._update();
return this;
},
The text was updated successfully, but these errors were encountered: