Allow hexadecimal colors (with opacities) and contextmenu
This PR is based on #95 and also uses the latest Leaflet.Glify version 3.3.1.
It is now possible to use hex-colors. The hex-colors can also have different opacities (depending on a variable) so it addresses #2. The different opacities only work for Polygons and Points. Lines do still have some bug..
The new version also allows for the creation of a contextmenu / right-clicks. addresses #79 Unfortunately it is not compatible with leaflet.extras2::contextmenu.
But with some JS knowldge one can create his own menues. I included an example with hex-colors, opacities and different contextmenues for shapes/lines and points in /inst/examples/contextmenu.R
The additional arguments to write_geojson_str where not correctly used until now. (e.g: digits, pretty, etc)
I had to assign them to json_opts directly. I also had to rewrite the *Src functions as they were throwing an error when no additional argument was passed, which resulted in an empty list, although a named list is expected.
This should now all work correctly.
But in general, I am not sure about the *Src functions. @tim-salabim Do you have any benchmarks where they are much faster?
But in general, I am not sure about the *Src functions. @tim-salabim Do you have any benchmarks where they are much faster?
IIRC it wasn't really about speed as such. Attaching the data to the html rather than including it has benefits mainly for panning/zooming performance. That said, it is a long time since I've benchmarked anything in this repo...