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

Support non-mapbox basemap layers #115

Open
JosiahParry opened this issue May 20, 2024 · 5 comments
Open

Support non-mapbox basemap layers #115

JosiahParry opened this issue May 20, 2024 · 5 comments
Labels
feature New feature or request

Comments

@JosiahParry
Copy link

I've tried exploring rdeck but right way I noticed that it doesn't have any base map support with free tiers. For example openlayers or maplibre are not supported. I don't want to give my credit card to mapbox in order to create an account! 🙈

It would be great if the package supported other basemaps.
https://deck.gl/docs/get-started/using-with-map

@jaredlander
Copy link

I know that in deck.gl in JavaScript you can skip the basemap and use a WMS (or similar) tile server output as a feature layer. This allows you to make maps without a map box token. Would be awesome if rdeck similarly allowed you to not include the basemap and exposed WMSLayer or similar.

Here's an example JavaScript map.

https://github.com/visgl/deck.gl/blob/9.0-release/examples%2Fwebsite%2Fwms%2Fapp.tsx

@anthonynorth anthonynorth added the feature New feature or request label May 27, 2024
@anthonynorth
Copy link
Member

Basemaps without a token can currently only be achieved with raster tiles, using the tile_layer.

Maplibre support is planned #119 and should be simple. WMSLayer support will come with deck.gl v9 (also planned)

@jaredlander
Copy link

So with V9 could we skip the basemap altogether and just use WMSLayer?

@anthonynorth
Copy link
Member

anthonynorth commented May 28, 2024

Yes. The basemap doesn't render if map_style = NULL, so you can do

# no basemap
rdeck(map_style = NULL) |>
  add_whatever_layer()

Looks like disabling basemap isn't documented! 🤦.

Edit: no-token / invalid token "works" also, but you'll get an error in the js console.

options(rdeck.mapbox_access_token = "nope")
pts <- vctrs::data_frame(
  position = rdeck::xy(runif(1e4, -180, 180), runif(1e4, -90, 90))
)

rdeck::rdeck() |>
  rdeck::add_scatterplot_layer(data = pts, radius_min_pixels = 2)

@jaredlander
Copy link

That's great, thanks. I look forward to trying it when the WMS layer is released.

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

No branches or pull requests

3 participants