2

Giving the example:

library(sp)
library(mapview)

data(meuse)
coordinates(meuse) <- ~x+y
proj4string(meuse) <- CRS("+init=epsg:28992")
mapview(meuse, cex = "cadmium", legend = TRUE)

I was expecting that legend=TRUE will display a legend with graduated circles, something similar like in this link. Is there a way to achieve this in mapview?

1 Answer 1

3

Can't be (easily) done with the current versions. mapview uses leaflet::addLegend which can only show a colour palette for a legend.

This issue has been sitting in the issue tracker since October 2016, so don't hold your breath waiting for it:

https://github.com/rstudio/leaflet/issues/316

and an earlier request from 2015, tagged P1, from 2015:

https://github.com/rstudio/leaflet/issues/111

Perhaps if you comment on those issues it might ping something at RStudio for them to implement it.

Your Answer

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

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