-
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
mouseHandler for addGeotiff (geoblaze.js) #28
Conversation
inst/htmlwidgets/lib/georaster-for-leaflet/georaster-binding.js
Outdated
Show resolved
Hide resolved
Thanks! Yeah I've been planning to include geoblaze for exactly that use. I've added a comment in the code: "Why only for shiny?" We should provide this functionality also in standard interactive mode |
Do you mean to include the I'm not aware of any way to pass an object from JS to R in interactive mode, that's why |
Yeah, my intention would be to have an argument |
With fc88895 the raster values now show up in a leaflet-control, very similar to I also included a check for the |
…nto mouseevent
Is this good to merge? I am planning to take care of all the things you've provided over the next two days. |
Not yet, I still have to adapt some things, but I wanted to wait for your revamped version. Is it already online? Another thing I noticed, the examples using |
No, I'll start working on cleaning the repo and merging things tomorrow. I'll let you know when I think everything is in a clean state. |
@trafficonese I've merged and cleaned a few things (mainly around projecting rasters). I think the current master is in a clean enough state to start getting this PR up and running. |
Nice! I got COG to work with the mouseHandler, but noticed that I have to load the COG differently.
and I changed it to
to make it work (see GeoTIFF/georaster-layer-for-leaflet#104). I guess this loads the whole data in memory, so might not be desired? In 2b75a37 I added the following arguments to
also.. Otherwise everything should work fine. 🎉 Shiny App with Mouseevents for addGeoRaster, addGeotiff and addCOG
|
Nice one! Yeah I think an And regarding the fetch, I wouldn't worry for now. It may well be the preferred way of doing things now in georaster for leaflet. Let's investigate this further if people report degraded performance |
I'll push the changes in a bit for Regarding
|
I understand, then I'll take care of the merge tomorrow, if you say it's ready by then. |
Ok, I think I have it now. We have the new argument ShinyApp
|
Thanks! This is a really nice addition! |
Using geoblaze.js allows to get the raster value at a certain lat/lng.
I modified leaflet's
mouseHandler
to allowclick
andmousemove
foraddGeotiff
.It could also be included in
addCOG
but so far I didn't manage to use that function successfully.I'm not sure if you want to include the new dependency (~1MB) or if you have something else in mind already. So feel free to close it or request additional changes.
Shiny example!