7

I've been working with interactive mapping within R for a while now and most of my experience lies in Leaflet (mostly the R package, but also a bit in Javascript). I just recently delved into mapview as an alternative and have a quick question about enabling the hover popup windows.

As you can see in this example with polygons, when you move your mouse over each polygon, a small popup window appears with each feature ID. The vector data description states:

in case you have the latest version of leaflet installed the map will also have a scale bar in the bottom left corner and provide labels of feature IDs if you hover over the features.

I have both Leaflet and Leaflet for R updated on my computer, yet this hover feature is not activated. The scale bar is also not shown. I used the mapview example of gadmCHE, as you'll see in the image below:

enter image description here

Does anyone know if this "latest version of leaflet" refers to leaflet.js or the R package leaflet? I just downloaded Leaflet 1.0.0-rc3 here and also made sure that I updated the leaflet package, so I'm not sure where to go from here to enable that hover/scalebar feature.

1 Answer 1

1

I think you need to install the latest version of leaflet (R package). Try:

devtools::install_github('rstudio/leaflet')

Update 1:

Try installing the development version of mapview

devtools::install_github("environmentalinformatics-marburg/mapview", ref = "develop")

That worked for me.

example

1
  • yes! Loading in the development version yielded the results I wanted. Hover windows are now in working order. :) Thanks!
    – Lauren
    Commented Oct 6, 2016 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.