When i want to use labels and colors parameters with addLegend() function inside a shinyAppthe legend is displayed in sta
I had the same problem. In my case, adjusting CSS of the legend solved the problem:
ui <- bootstrapPage(
tags$style(type="text/css", "div.info.legend.leaflet-control br {clear: both;}"),
...
)
One of the reason it may happen is when the web-page is zoomed in i.e. the zoom level is more than 100%.
Make sure you are not zoomed in. Press Control + 0 from your keyboard to reset zoom to 100%. Also, try using another web-browser if problem persists.
I had the same silly problem since my browser was zoomed in (>100%).