I realized my last pull request introduced an error when running devtools::check() because it was importing ggspatial::layer_spatial but had kept ggspatial under Suggests. I added a check using rlang::check_installed() so the package can keep ggspatial under Suggests and avoid the need to have the package under Imports.
I also made several minor improvements to static_mapbox:
feat: allow NULL zoom (or lon/lat) and NULL width/height for static_mapbox
feat: set lon/lat based on centroid of location if location is not NULL and zoom is not NULL
feat: validate zoom/bearing/pitch using match.arg (allowing NULL values)
docs: minor updates to documentation
If you are OK with it, I'd also like to implement the attribution and logo parameters supported by the Mapbox static maps API. I can add that change to this pull request or a separate one after this is merged (since it may make sense to implement the same option to show or hide attribute to the addMapboxTiles function at the same time).
looks good, thanks! yes, attribution would be great. I typically take care of that as a map caption which isn't always ideal so having that come through on the map itself would be helpful.
I realized my last pull request introduced an error when running devtools::check() because it was importing ggspatial::layer_spatial but had kept ggspatial under Suggests. I added a check using rlang::check_installed() so the package can keep ggspatial under Suggests and avoid the need to have the package under Imports.
I also made several minor improvements to
static_mapbox
:static_mapbox
If you are OK with it, I'd also like to implement the attribution and logo parameters supported by the Mapbox static maps API. I can add that change to this pull request or a separate one after this is merged (since it may make sense to implement the same option to show or hide attribute to the
addMapboxTiles
function at the same time).