SymbolixAU / mapdeck

R interface to Deck.gl and Mapbox
https://symbolixau.github.io/mapdeck/articles/mapdeck.html
362 stars 40 forks source link

Legend option for bitmap layer #390

Open MalditoBarbudo opened 1 month ago

MalditoBarbudo commented 1 month ago

What do you want the feature to do? As it is now, add_bitmap doesn't accept a legend argument. I understand that is not possible to calculate automatically a legend for an image, but it would be nice to have the option to add a manually created legend with legend_element and mapdeck_legend. This is useful when the bitmap layer is a png-converted raster conveying some kind of information (i.e. vegetation cover, climatic variables, population...). In fact, a general function (add_legend(map, mapdeck_legend, ...) or add_custom_legend(map, mapdeck_legend, ...)) would be a nice thing to have.

Similar examples leaflet has the addLegend function for adding custom legends.