-
Notifications
You must be signed in to change notification settings - Fork 41
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
add R/map_location.R #82
Conversation
Ping @MilesMcBain |
Thanks for this, and I can see the logic. But, I'm wondering if there's a way we can do it without passing the And I think we need to consider if the map should zoom to a specific layer, or show all the layers. Take this contrived example mapdeck( location = roads ) %>%
add_path( data = roads ) %>%
add_scatterplot( data = capitals ) All the This may need to be handled at the |
Yeah, fair point, although my view on those things at the moment is that until it is clear that most operations will be piped, the primary The larger issue of where best to focus can then be handled through percolating through series of modifications to your current
Each call can then simply query |
I think it's on the right lines. And I think I need to handle the multiple layers each requiring their own bounding-box within the javascript code, where I can make use of the The Also, for #78, I'm moving away from |
That sounds good. One extra thought: It will likely be useful / necessary somewhere down the line to enable a fixed grid to be plotted (as in any pandoc-type outputs where strict control might be desirable). What I mean is creation of some kind of static document from (for example) an And so
will simply stay focussed on Melbourne, but
would zoom out to encompass all capitals |
yeah I'm thinking along those lines too. I'm also considering something like mapdeck() %>%
add_scatterplot( data = capitals ) %>%
add_path( data = roads, focus_layer = T ) So you can focus the viewport on a specific layer. I think this will be useful in Shiny when adding & removing multiple layers. |
I can't find any reference in But I think we can make use of the OSM zoom levels (which mapbox uses) to calculate the required zoom for each layer
|
Argh - it's caused inside |
Each layer now gets an It's a bit crude, but I think it's OK for now. |
This addresses #78 by getting rid of current warnings described there, and also enables this:
The map will then be centred on the
roads
item. @tim-salabim is happy to help with the zoom-to-bbox kinda stuff necessary to establish values forzoom
, althoughdeck.gl
seems to do this quite differently toleaflet
...?