Leaflet maps break on rpubs with hide toolbars and tabbed document

I publish a knitr/markdown document on rpubs that has some interactive maps generated by leaflet. In general, I haven't had any issues with these, but in the most recent document, the map view "breaks" when I hide the rpubs toolbars.

The maps in question are located in specific tabs in the document (created with {.tabset}). When I hide the toolbar, the map on the active tab is still fine, but if I then select one of the other tabs, those maps no longer render properly, and can only be recovered if the document is reloaded in the browser window.

Document is here, use the TOC to navigate to the maps. Code for the maps is folded.

Would love to know if this is a known problem, and if there's a fix for it. Thx!

Huh! I can reproduce the problem, but I have absolutely no clue how this could happen! The only thing that button does is change the CSS class on the <body> tag--but not even the body of the document, rather the body of the embedding iframe page! So this doesn't make any sense to me at all.

Perhaps you could work around this by linking directly to the content URL? State trends in the risk of being killed by police 2000-2020

Thanks for the quick reply. That direct link has broken maps for both of the ones on the second tab (the color-coded maps).

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.