angular-ui / ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
http://angular-ui.github.io/ui-leaflet
Other
314 stars 134 forks source link

Allow titles on map legend #324

Open pedrorocha-net opened 7 years ago

pedrorocha-net commented 7 years ago

We can allow users to add extra HTML markup on the legend, at least for a title before the items.

On _getOnAddArrayLegend() function, we can simply add div.innerHTML += '<div class="title">' + legend.title + '</div>'; after var div = L.DomUtil.create('div', legendClass);

Need to sanitize and check if the title is there, but i'm still getting used to Leaflet and ui-leaflet, so i'm not sure if I have enough time to make a patch and PR.

If anyone could help here, would be great.