Skip to content

Feature Request: Add text (e.g. static labels) to map #218

Closed
@tiernanmartin

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions