update leaflet and support legends on layers