r-leaflet

R Leaflet PopupGraph - addPopupGraphs on map_marker_click

孤者浪人 提交于 2021-02-19 07:11:02
问题 I would like to open a popup with a unique plot for each of my marker in it on a map_marker_click using r leaflet and the leafpop library. For each point when the user click on them the plot to display is computed. Below is a reproductible code but it doesn't return any error. Any ideas? library(tidyverse) library(ggplot2) library(shiny) library(leaflet) library(leafpop) id <- c(1,1,1,1,2,2,3,3,3,4) lat <- c(49.823, 49.823, 49.823, 49.823, 58.478, 58.478, 57.478 , 57.478 , 57.478, 38.551) lng

R Leaflet PopupGraph - addPopupGraphs on map_marker_click

≯℡__Kan透↙ 提交于 2021-02-19 07:09:13
问题 I would like to open a popup with a unique plot for each of my marker in it on a map_marker_click using r leaflet and the leafpop library. For each point when the user click on them the plot to display is computed. Below is a reproductible code but it doesn't return any error. Any ideas? library(tidyverse) library(ggplot2) library(shiny) library(leaflet) library(leafpop) id <- c(1,1,1,1,2,2,3,3,3,4) lat <- c(49.823, 49.823, 49.823, 49.823, 58.478, 58.478, 57.478 , 57.478 , 57.478, 38.551) lng

How do I remove a selection made using Shiny and mapedit by clicking again on the feature?

独自空忆成欢 提交于 2021-02-10 06:57:43
问题 Using Shiny, leaflet, and mapedit packages I can generate a graph with multiple series using the code below. Intuitively I would like to click on a selected map icon a second time and the associated data is removed from the graph. Essentially the click event can be toggled on or off. Does anyone have any suggestions? # devtools::install_github("r-spatial/sf") # devtools::install_github("r-spatial/mapview@develop") # devtools::install_github("bhaskarvk/leaflet.extras") # devtools::install

remove mapedit features programmatically

依然范特西╮ 提交于 2021-02-08 20:33:39
问题 With mapedit it is possible to clear drawn features using the 'trash' icon built into the drawbar UI. It is also possible to clear features associated with the leaflet map using clearMarkers() and leafletProxy() , as laid out in this issue. However, leafletProxy does not clear any features drawn by the user. How do I programmatically clear these features? (e.g. after clicking an actionButton). Here is a simple shiny app and more explanation: library(mapedit) library(mapview) library(shiny) ui

remove mapedit features programmatically

喜你入骨 提交于 2021-02-08 20:29:31
问题 With mapedit it is possible to clear drawn features using the 'trash' icon built into the drawbar UI. It is also possible to clear features associated with the leaflet map using clearMarkers() and leafletProxy() , as laid out in this issue. However, leafletProxy does not clear any features drawn by the user. How do I programmatically clear these features? (e.g. after clicking an actionButton). Here is a simple shiny app and more explanation: library(mapedit) library(mapview) library(shiny) ui

Select multiple items using map_click in leaflet, linked to selectizeInput() in shiny app (R)

一世执手 提交于 2021-02-07 03:46:37
问题 I would like to create a leaflet map where you can select multiple polygons and this will update the selectizeInput() in a shiny app. This would including removing a selected polygon, when it is removed in the selectizeInput() . I have slightly changed/updated the code from the answer here (use of sf instead of sp and more dplyr where I could work out what the base R was). The polygons could probably be updated with an observeEvent tied in with input$clicked_locations , but not sure exactly

Select multiple items using map_click in leaflet, linked to selectizeInput() in shiny app (R)

喜夏-厌秋 提交于 2021-02-07 03:45:23
问题 I would like to create a leaflet map where you can select multiple polygons and this will update the selectizeInput() in a shiny app. This would including removing a selected polygon, when it is removed in the selectizeInput() . I have slightly changed/updated the code from the answer here (use of sf instead of sp and more dplyr where I could work out what the base R was). The polygons could probably be updated with an observeEvent tied in with input$clicked_locations , but not sure exactly

Cache or pre render leaflet map in shiny app

◇◆丶佛笑我妖孽 提交于 2021-02-03 05:58:50
问题 I am trying to map ~8000 polygons using leaflet and run into performance issues. As I am using the map within a shiny app, I was wondering if its possible to somehow cache or pre-render the map. Note that in my case, I have different layers of polygons that are swapped following this approach. A small MWE would be this: The data can be downloaded from here library(shiny) library(leaflet) library(sf) ## Download Shapefile file <- "plz-gebiete.shp" if (!file.exists(file)) { url <- "https://www

Cache or pre render leaflet map in shiny app

爷,独闯天下 提交于 2021-02-03 05:56:53
问题 I am trying to map ~8000 polygons using leaflet and run into performance issues. As I am using the map within a shiny app, I was wondering if its possible to somehow cache or pre-render the map. Note that in my case, I have different layers of polygons that are swapped following this approach. A small MWE would be this: The data can be downloaded from here library(shiny) library(leaflet) library(sf) ## Download Shapefile file <- "plz-gebiete.shp" if (!file.exists(file)) { url <- "https://www

Cache or pre render leaflet map in shiny app

一笑奈何 提交于 2021-02-03 05:56:04
问题 I am trying to map ~8000 polygons using leaflet and run into performance issues. As I am using the map within a shiny app, I was wondering if its possible to somehow cache or pre-render the map. Note that in my case, I have different layers of polygons that are swapped following this approach. A small MWE would be this: The data can be downloaded from here library(shiny) library(leaflet) library(sf) ## Download Shapefile file <- "plz-gebiete.shp" if (!file.exists(file)) { url <- "https://www