16EAGLE / basemaps

A lightweight package for accessing basemaps from open sources in R 🗺️
https://jakob.schwalb-willmann.de/basemaps
GNU General Public License v3.0
57 stars 15 forks source link

Support for specifying tile zoom level? #15

Closed stevenbedrick closed 1 year ago

stevenbedrick commented 1 year ago

Hello! First, thanks so much for this library, it is a real pleasure to use. So my question is about whether it is possible to specify the zoom level (along with the map service and map type). Many map services offer tiles at a variety of zoom levels, but I can't see where or how to specify that using basemaps- looking at the code, it appears to be using whatever slippymath::bbox_to_tile_grid() uses as a default for the given map service (see here). Am I missing an option somewhere?

16EAGLE commented 1 year ago

Thanks for solving this by adding that feature through a PR!

For the record, one can now run something like

basemap_magick(ext, custom_zoom = 3) #or
basemap_magick(ext, custom_zoom = 6) #and so on

or similar to change zoom level/map detail, overruling map_res.

stevenbedrick commented 1 year ago

Oh cool, that's definitely better nomenclature- thanks!