-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fgb highlight fix #101
Fgb highlight fix #101
Conversation
@trafficonese - thanks very much for adding those details on styling, I was really struggling to work it out! I can get it to work with |
what about this example - does that work for you? Or is that not what you're looking for?
|
Thanks for the quick reply. Ah I forgot Would it be possible to add a #' data$fillColor <- colorNumeric(palette = "viridis", domain = data$var)(data$var)
#' sf::st_write(obj = data, dsn = "myfile.fgb", driver = "FlatGeobuf")
#' leafem::addFgb(file = "myfile.fgb", fill = TRUE, fillColor = NULL)
#' ``` |
you mean in the package documentation? |
Yeah, alongside the other updates in the |
@jpd-defra done :) I hope this helps.. Line 369 in c9c1183
|
Thanks very much! |
I vaguely remember that this was commented out because of issues with automatic rendering of lines... But can't remember all the details. |
it was about mapview.. #24 (comment) |
Yes, that was it! As a heads-up, my current plan is to update leafem as much as possible, submit to CRAN and then move on to updating mapview with all the new functionality provided by leafem. Let's see how this will pan out then. I think there should be some way to automatically handle this This PR will be merged shortly. I should be able to find some time to get leafem to a submittable state over the next few weeks. |
This PR fixes issues with highlighting behavior (mouseout) in addFgb by correctly restoring the original style using a deep copy of the
style
object (withstructuredClone
and{ ...style }
). Previously, only thecolor
property was partially supported, and its behavior was incorrect. See FGB attach by group, highlightOptions, label as function #85 for an example app.Introduced the function
updateStyleFromProperties
to update the highlighted style, if the relevant function argument is NULL and the data has a property with this name (e.g.:color
,weight
, etc..).Added some explanation to the @details section, outlining how to use direct styling arguments and feature-based styling from data properties. Addresses addFgb color depend on a variable? #87
I also simplified some
map$dependencies
calls and addedRoxygen: list(markdown = TRUE)
do the Description. This helps with rendering the docs correctly.