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 drawing map with multiple WMSTile layers on initial load all three attributions (for each separate WMS layer) are printed as attribution. After first change everything is as should be and attributions are correctly displayed.
@DonNicoJs do you think there might still be an issue around how the LControlLayers component works in this situation, or shall we close this? The Leaflet docs do say that "when using multiple base layers, only one of them should be added to the map at instantiation, but all of them should be present in the base layers object when creating the layers control".
So perhaps there's an argument that the logic in LMap.addLayer should attempt to automatically add only the first (visible) base layer to the map, and add all subsequent base layers to only the layers control, then let it take care of handling which layer is added to the map at any given time. But since setting visible on each layer gives the user a straightforward way to determine the initial configuration explicitly, I don't know whether that would be useful behaviour.
Description
When drawing map with multiple WMSTile layers on initial load all three attributions (for each separate WMS layer) are printed as attribution. After first change everything is as should be and attributions are correctly displayed.
Live Demo
https://codesandbox.io/s/eager-feather-vf691
Steps to Reproduce
Create two or more separate WMS layers with different attribution and on initial load all three attributions will be showed.
Expected Results
On initial load only attribution of selected WMS base layer should be displayed as attribution.
Actual Results
On initial load all three attributions are showed and only after first change the attribution is correctly displayed.
Browsers Affected
Versions
The text was updated successfully, but these errors were encountered: