-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tmap code fails on 'Run code' but works on tutorial load or 'Start Over' #484
Comments
Thanks for the report @andysouth. The issue was caused by a call like htmltools::tags$head(
htmltools::HTML("<style>.leaflet-container {background: #FFFFFF;}</style>")
) somewhere in the process that creates the leaflet map. learnr doesn't allow users to add arbitrary HTML dependencies because we don't want code run by the user to disrupt the appearance or functionality of the running tutorial. As a result, the dependency created by the code above gets removed from the HTML output returned by the user's exercise code. If you want to match the default tmap appearance, you can include such a statement in an R chunk in your tutorial. This issue should be fixed when #486 merges, please report back if this does not resolve your problem! |
Many thanks @gadenbuie for the prompt response. Yes, this works for me now. See in action here : https://andysouth.shinyapps.io/intro-to-spatial-r/#section-interactive-maps |
System details
Output of
sessioninfo::session_info()()
:Example application or steps to reproduce the problem
https://andysouth.shinyapps.io/test-tmap-view/
https://github.com/afrimapr/afrilearnr/blob/main/inst/tutorials/test-tmap-view/test-tmap-view.Rmd
Describe the problem in detail
The chunk above - the Hello World ! example from tmap, with tmap_mode(“view”) added, works when the tutorial is loaded, or on 'Start Over' or when run from console, but fails (with $ operator is invalid for atomic vectors) when ‘Run Code’ is pressed
The text was updated successfully, but these errors were encountered: