How to split an interactive map title into two lines in tmap?

I was just wondering how to split a title for an interactive map? The "\n" can be used to split a long text into two lines for static maps; hower, this doesn't work for an interactive map.
"tm_credits" also doesn't work for an interactive map. Is there a way to include map credits (data source) on an interactive map?

You might want to consider utilizing the Leaflet.js library directly via the {leaflet} package from RStudio.

It has pros & cons:

  • the syntax is yet again different (from {tmap} and {ggplot2}, with which I presume you are familiar)
  • it allows standard HTML tags in your text, i.e. <br> forces a new line, and you can include a hyperlink in your popups via the anchor tag
  • it supports adding a custom text to the attribution box in lower right corner of the interactive map

As far as I know there is currently no way to access the attribution layer from tmap.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.