SymbolixAU / mapdeck

R interface to Deck.gl and Mapbox

Home Page:https://symbolixau.github.io/mapdeck/articles/mapdeck.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add legend_position argument

chrislim5 opened this issue · comments

I didn't see an easy option to move the legend position. Something like legend_position = "topright" in the add_layer functions would be helpful. An example in the documentation of editing the CSS to move the legend could also be useful - I wasn't able to move the legend using the legend_options argument, but I'm not familiar with CSS.

Is it actually possible to change the legend position using the legend_options argument or css argument in legend_element()? I am able to change the appearance of the legend (e.g., max-height and background color), but haven't had any success moving the legend position.

commented

hi @chrislim5 , sorry I didn't see this first time around.

The specific div element that controls the legend's position is the .legendContainer. But it's not currently possible to override this in the legend_options() argument.