heigeo / leaflet.wms

A Leaflet plugin for working with Web Map services, providing: single-tile/untiled/nontiled layers, shared WMS sources, and GetFeatureInfo-powered identify.
http://heigeo.github.io/leaflet.wms/
MIT License
242 stars 135 forks source link

remove source from map properly, symmetric to addition. #60

Open jjimenezshaw opened 5 years ago

jjimenezshaw commented 5 years ago

wms.Layer.onAdd is adding this._source to this._map, but is not removed symmetrically on onRemove.

The consequence is that the attribution is never removed if the layer is removed/managed using L.Control.Layers. If you change to different layers that use wms.Layer, the attributions are appended (never removed), even if you remove the layer.