Skip to content

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?

@trafficonese trafficonese merged commit 7af1dcc into r-spatial:master Jul 29, 2025
7 checks passed
@tim-salabim
Copy link
Member

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...

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.

2 participants