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

Mapbox won't render in Quarto #3

Open
walkerke opened this issue Jun 28, 2024 · 6 comments
Open

Mapbox won't render in Quarto #3

walkerke opened this issue Jun 28, 2024 · 6 comments

Comments

@walkerke
Copy link
Owner

At the moment, Quarto can't accommodate JS libraries served over a CDN because it expects a local resource path. Follow up on options for Mapbox GL JS re: licensing and how I can handle this.

@walkerke
Copy link
Owner Author

Following this discussion: quarto-dev/quarto-cli#10325

Also finding out if Mapbox GL JS can be bundled in the package from Mapbox which would solve the problem, so this issue's resolution is TBD.

@walkerke
Copy link
Owner Author

Now tracking at quarto-dev/quarto-cli#10339

@wiesehahn
Copy link

so its still valid that we cant render mapgl in quarto, right?
The title here suggests that this is true for Mapbox, but can it be done with maplibre?
I get the same error when trying to render maplibre

Error in FUN(X[[i]], ...) : 
  Dependency mapbox-gl-draw 1.4.3 is not disk-based
Calls: .main ... dependencies_from_render -> html_dependencies_as_string -> lapply -> FUN
Execution halted

Is there any option to make this possible for maplibre (as I guess the license problem does not apply here)

@walkerke
Copy link
Owner Author

walkerke commented Oct 1, 2024

@wiesehahn yes, at the moment.

I was hoping the Quarto team would fix on their end as I prefer to pull in the assets via CDN given the way Mapbox GL JS is licensed. However it doesn't seem like the issue is high-priority.

What I can do for now is set up the MapLibre dependencies locally so it can be used in Quarto docs.

walkerke added a commit that referenced this issue Oct 1, 2024
@walkerke
Copy link
Owner Author

walkerke commented Oct 1, 2024

@wiesehahn I've switched to local dependencies for MapLibre and successfully rendered a Quarto doc with all of those dependencies used. Install from GitHub and try this out:

---
title: "MapLibre Quarto test"
format: html
editor: visual
---

## MapLibre test

Let's try out MapLibre in a Quarto doc with a draw control and a geocoder, using all local dependencies:

```{r}
library(mapgl)

maplibre() |> 
  add_draw_control(freehand = TRUE) |> 
  add_geocoder_control()

image

@wiesehahn
Copy link

Great! thanks

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

2 participants