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

Custom tile layer (slippy map) #365

Open
ratnanil opened this issue Mar 9, 2023 · 3 comments
Open

Custom tile layer (slippy map) #365

ratnanil opened this issue Mar 9, 2023 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@ratnanil
Copy link

ratnanil commented Mar 9, 2023

Is there a way to use custom base maps with mapdeck? I'm thinking along the lines of the OSM slippy maps. There is something on this topic on deck.gl.

@ratnanil ratnanil added the question Further information is requested label Mar 9, 2023
@dcooley
Copy link
Collaborator

dcooley commented May 1, 2023

This is not currently possible. I keep intending to look into this but just don't have the time. If you know of a solution I'll happily accept a PR

@kmcd39
Copy link

kmcd39 commented Jul 1, 2024

I got mapdeck working with .json files that specify basemap layers. And you can change the .json to customize the tile layers. Below will also work if you save the .json and modify it locally.

Example below, drawing on carto's base layers

library(mapdeck)
library(jsonlite)

style.pth <- "https://raw.githubusercontent.com/CartoDB/basemap-styles/master/mapboxgl/dark-matter-nolabels.json"

style.json <- jsonlite::read_json(style.pth)

mapdeck::mapdeck(
  style = style.json
  #"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
  ,location = c(-73.9165, 40.7514)
  ,zoom = 10
)

@dcooley
Copy link
Collaborator

dcooley commented Jul 1, 2024

@kmcd39 you don't need the jsonlite::read_json() step, the style argument will accept the URL as input:

mapdeck::mapdeck(
	style = style.pth
	,location = c(-73.9165, 40.7514)
	,zoom = 10
)

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

No branches or pull requests

3 participants