mapview
mapview copied to clipboard
refactor options etc
In order to make mapview a bit nicer to use and more versatile to control on a per-session basis, we're going to refactor the mapviewOptions so they include all relevant arguments passable to mapview. At the same time we will only leave the most commonly used arguments in the function definition and pass everything else via .... This obviously needs some adjustments, namely:
- [ ] add all possible arguments to
mapviewOptions - [ ] delete all lesser used arguments from function definition (see [1])
- [ ] use
modifyListto update these options within themapviewcall (see below [2]) - [ ] provide proper documentation section for deleted arguments (now accepted via
...)
Other things to tackle in this major refactoring:
- [x] convert internal raster stuff to stars (if possible, @edzer I might pick your brains at some stage for this)
- [x] add support for
mapdeckas a rendering platform (@SymbolixAU @dcooley I might pick your brains at some stage for this) - [x] move remaining functionality to
leafem- see https://github.com/r-spatial/leafem/issues/3 (@lbusset I haven't forgotten about this)
[1] slide 4
[2] this (or some variant of it) should be sufficient:
opts = mapviewOptions() # get all (potentially user modified) options
opts = modifyList(opts, list(...)) # override with whatever was passed via ...
garnishMap(mapview, opts) # or whatever function is being called at this stage
garnishMap should be able to handle pretty much all cases here (incl. mapdeck once we allow for it). We might need some sort of look-up function to map mapview arguments to leaflet/mapdeck