Revert add/rm attr in favour of whole layer
The original idea of swapping out the old attribution for the new instead of completely removing and re-adding the layer had merit, but led to incorrect attributions on the map if other layer properties were also changed. Specifically, if props changed attribution "A" to "B" and name "layer A" to "layer B", then: * Attribution "A" would be remove and "B" added. * The layer would be removed from the map entirely. * The layer would be added back, _with its original options.attribution_ still equal to "A". * Attribution on the map would read "A, B". This updated approach resolves that by changing the option on the layer object before re-adding it to the map, and otherwise letting Leaflet take care of adding and removing attributions as the layer is changed.
Loading
Please register or sign in to comment