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?

Guz
  • 3,176
  • 2
  • 18
  • 40
Valentin_Ștefan
  • 397
  • 2
  • 16

1 Answers1

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.

Spacedman
  • 63,755
  • 5
  • 81
  • 115