I’m using leaflet with the leafpm toolbar and would like to edit the tooltips of the different tools from the toolbar. By default, the tooltips are “Zoom In”, “Zoom Out”, “Draw Marker”, “Draw Polygon”, “Draw Polyline” and I’d like to customize them to best fit the specific usage of my leaflet (e.g., replace “Draw Polygon” by “Draw the borders of your field”).
I found some JS solutions to change tooltips languages (Changing Leaflet map tooltip language) with L.drawLocal.draw.toolbar.buttons.polygon = “Draw the borders of your field” but I don’t know how to use that in R.
Any help would be greatly appreciated! You’ll find a basic map with the leafpm toolbar showing the tooltips mentionned above.
library(shiny) ; library(leaflet) ; library(mapedit) ; library(leafpm)
ui<-shinyUI(
editModUI("map", height=600)
)
server <- function(input, output, session) {
observe({
edits <- callModule(
editMod,
leafmap = leaflet() %>% addTiles(),
id = "map",
editor="leafpm",
editorOptions=list(toolbarOptions = pmToolbarOptions(drawMarker=T, drawPolygon=T, drawPolyline=T, drawCircle=F, drawRectangle=F, removalMode=T, cutPolygon=T, editMode=T))
)
})
}
shinyApp(ui = ui, server = server)