Skip to content
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

maps created using mapview are not rendered #85

Open
wykhuh opened this issue Dec 16, 2024 · 0 comments
Open

maps created using mapview are not rendered #85

wykhuh opened this issue Dec 16, 2024 · 0 comments

Comments

@wykhuh
Copy link

wykhuh commented Dec 16, 2024

I’m trying to create a lesson that uses R package mapview to render an interactive map. mapview uses leaflet.js

If I create a normal R Markdown page, and use knitr to create an html page, the mapview map is included in the html. Scroll to bottom of page to see interactive map of L.A.
demo: https://wykhuh.github.io/map-view_demo/
code: https://github.com/wykhuh/map-view_demo/blob/main/mapview.Rmd

When I use the use the same R Markdown code to create a lesson via Sandpaper, the interactive map is blank. The div for the interactive map is created, but the map is not rendered.
demo: https://wykhuh.github.io/carpentries_mapview/introduction.html
code: https://github.com/wykhuh/carpentries_mapview/blob/main/episodes/introduction.Rmd

I posted this bug in The Carpentries Slack, and Toby Hodges replied:

Indeed, it looks like mapview uses leaflet.js as a backend, and that is not loaded into the lesson website. As I understand it, the site template in the varnish package would need to be adjusted to be able to include the required JS library/libraries for lessons that want to use mapview. This could be achieved in a similar way to how mathjax is loaded in to displayor LaTeX equations.

Please open an issue on the Workbench repositor so we can discuss whether this is something that should be included in varnish, or whether we should instead recommend that you develop a customised version of the template for this purpose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant