Feature Request: Add text (e.g. static labels) to map #218
Description
This request stems from another leaflet
package user's question posted on Stackoverflow.
I'd like to add static text labels to a leaflet map that I built and deployed with shiny
.
You can check it out here: https://maynardandking.shinyapps.io/Census-Data-and-Leaflet-Map
And the code is available here: https://github.com/tiernanmartin/Census-Data-and-Leaflet-Map/blob/master/app.R
As you can see, I'm currently using the leaflet
package's popup objects to label the counties. It sorta works, but I don't really like that there's a caption box around the text – it's eye-catching and it distracts the viewer from the main point of this choropleth: the color of the census tracts.
I also am not too happy with the way that the basemap's labels are blocked by the polygon layers. I know I could address this by adjusting the opacity of the polygon layer, but I'd prefer to leave the opacity as-is and add my own labels layer on top of the polygons.
Could you add a feature that allows text to be added to a location on the map without using popups or markers? I'm thinking of a function that is identical to addPopups
except that it just displays the text and inherits styling from the map's .css file.
Thanks for the great package!
Activity