how can I add names to the the center of my polylines? I added a snippet of the code:
Where do I have to put what code, to get the example at the bottom? Text should be always there, no popup or hide or hover.
With thematic map, it would be just tm_text("county") at addPolylines. Thanks in advance!
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addMarkers(
lng= 125.781199, lat= 39.039555,
label="fun",
labelOptions = labelOptions(noHide = FALSE, direction = "bottom", offset=c(0,5))) %>%
addPolygons(data=data,
stroke=FALSE,
smoothFactor = 0.2,
fillOpacity = 0.8,
label = lapply(list, HTML),
color= ~pal(data$data)) %>%
addPolylines(data = county,
fillColor = "transparent",
color = "#000000",
stroke = TRUE,
weight = 1.5,
smoothFactor = 0.5,
group = "county") %>%
addLegend(position = "topright",
pal = pal,
values = data$data,
title = "",
opacity = 1,
labFormat = labelFormat(suffix = " %",
transform = function(x) 100 * x))