Skip to content

Allow hexadecimal colors (with opacities) and contextmenu #105

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

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

trafficonese
Copy link
Collaborator

@trafficonese trafficonese commented Apr 5, 2025

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

trafficonese and others added 21 commits June 3, 2024 21:11
…ivity, hoverWait, etc), expose mouseover to Shiny, dont reassign ...
…d "clearGlGroup", set active = TRUE/FALSE when hiding/showing, refactor docs
Merge branch 'fixlabels' of https://github.com/trafficonese/leafgl into fixlabels

# Conflicts:
#	DESCRIPTION
… respected until now..

fix color tests, since hexcolors are not encoded to a color-matrix anymore
@trafficonese
Copy link
Collaborator Author

trafficonese commented Apr 5, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant