I found a solution to this issue. The title can be set when the leaflet object is written to a HTML file using either htmlwidgets::saveWidget
or mapview::mapshot
:
mapshot(x=lf,url="map.html",title="Map title")
I found a solution to this issue. The title can be set when the leaflet object is written to a HTML file using either htmlwidgets::saveWidget
or mapview::mapshot
:
mapshot(x=lf,url="map.html",title="Map title")
I am using the R leaflet package to generate a map. When the web page is created, the <title>
element of the web page is set to “leaflet”:
<title>leaflet</title>
I would like to change this to something more informative, but I cannot see a way to do this. I have seen the discussion here, but that is to add a title on the map itself. I want to do something different: set the title that is shown at the top of the browser tab.
Is there a simple way to do this using leaflet or htmltools?