leaflet.extras2 icon indicating copy to clipboard operation
leaflet.extras2 copied to clipboard

Request leaflet-mapwithlabels

Open SugarRayLua opened this issue 9 months ago • 2 comments

Hi. I'm new working with leaflet and needing to clearly label the regional subdivision of a country for a figure and would find it helpful if leaflet could automatically plot the labels for those regions included in the Shapefiles that I give leaflet within the approximate centers of those regions as does the leaflet-map with labels leaflet.js plugin below:

https://github.com/samanbey/leaflet-mapwithlabels?tab=readme-ov-file

(see attached examples 1, 2)

That would be much handier than having to calculate the lat/long for each region from the shapefile lat/long coordinates and then calculate the approximate center coordinates and give those values to leaflet to plot the labels.

I noticed that ggplot2 already has a function to automatically plot shape labels on a choropleth:

geom_sf_label()

(see attached example 3)

Thanks for considering this request.

Image

Image

Image

SugarRayLua avatar Apr 15 '25 08:04 SugarRayLua