我正在使用R中精彩的传单包,我想知道是否有办法提供这样的工具提示:
1-用户可以绘制一个矩形和
2-考虑到地图的缩放级别和工具提示矩形的腿,代码可以估计矩形的实际物理尺寸(例如,英尺)
## This doesn't work and mixes metaphors from leaflet and ggvis
## It's just pseudocode to give intuition
library(leaflet)
library(ggvis)
lb <- linked_brush()
map <- leaflet() %>% addTiles() %>% addCircleMarkers() %>% lb()
size <- lb()$rect_width * lb()$rect_height * map$zoom_factor