r-leaflet

Adding color to polylines in leaflet in R

人盡茶涼 提交于 2021-01-28 08:13:09
问题 I have had a look at this and other links therein. This is exactly what I am trying to achieve and failing. Here is some sample data: structure(list(lat = c(51.88783, 51.8878441, 51.887825, 51.88659, 51.8866959, 51.8874931, 51.89359, 51.8941269, 51.8977051, 51.8994331, 51.90773, 51.91324, 51.91604, 51.9216652, 51.93353, 51.9419365 ), lon = c(4.28763342, 4.287635, 4.28765154, 4.29007339, 4.29562664, 4.29917, 4.30641174, 4.30561829, 4.29263353, 4.284498, 4.261132, 4.24711847, 4.241075, 4.23262,

R Leaflet Map Polygon Labels on highlight have incorrect label

谁都会走 提交于 2020-08-25 03:55:30
问题 I am creating a map in R using leaflet and the labels for my polygons are not lining up with what their value should be. The map is meant to separate just Ontario by FSA (Forward Sortation Area), the geojson includes all the FSAs in Canada. So first I subset just the FSAs for Ontario (Using their first letter as this is how FSAs work). file_path <- "data/regions.geojson" fsa <- geojsonio::geojson_read( x=file_path, what="sp" ) #Get subsets fsa_ont <-subset ( x=fsa, subset= grepl( x=fsa@data

How to assign popup on map polygon that corresponds with the country R leaflet

妖精的绣舞 提交于 2020-07-09 03:00:27
问题 I am trying to write a script that would allow people to click on a country then a popup would appear and show the country's name and corresponding value. I have successfully created the map and the boundaries of each country, however when you click on, for example Russia, the popup would show India. Below is a simplified version of the script: library(leaflet) library(maps) countries <- c("Australia", "South Africa", "India", "Mexico", "USA", "Russia") values <- c(1,2,3,4,5,6) bounds <- map(

How to assign popup on map polygon that corresponds with the country R leaflet

人盡茶涼 提交于 2020-07-09 03:00:08
问题 I am trying to write a script that would allow people to click on a country then a popup would appear and show the country's name and corresponding value. I have successfully created the map and the boundaries of each country, however when you click on, for example Russia, the popup would show India. Below is a simplified version of the script: library(leaflet) library(maps) countries <- c("Australia", "South Africa", "India", "Mexico", "USA", "Russia") values <- c(1,2,3,4,5,6) bounds <- map(

R Shiny map search input box

假装没事ソ 提交于 2020-06-24 10:24:32
问题 In google maps, the search input box auto completes addresses as a user types. Is there a way to do this in R Shiny with access to the autocomplete value in order to use with a mapping package? There is a javascript method here. I've tried to use this method in R Shiny in the code below. SymbolixAU pointed out using google_map( search_box = TRUE ) which is a simple solution. Unfortunately it doesn't work in my code and also because I would like the search box to be separate from the map. The

R Shiny map search input box

痴心易碎 提交于 2020-06-24 10:24:27
问题 In google maps, the search input box auto completes addresses as a user types. Is there a way to do this in R Shiny with access to the autocomplete value in order to use with a mapping package? There is a javascript method here. I've tried to use this method in R Shiny in the code below. SymbolixAU pointed out using google_map( search_box = TRUE ) which is a simple solution. Unfortunately it doesn't work in my code and also because I would like the search box to be separate from the map. The

R Shiny map search input box

老子叫甜甜 提交于 2020-06-24 10:24:03
问题 In google maps, the search input box auto completes addresses as a user types. Is there a way to do this in R Shiny with access to the autocomplete value in order to use with a mapping package? There is a javascript method here. I've tried to use this method in R Shiny in the code below. SymbolixAU pointed out using google_map( search_box = TRUE ) which is a simple solution. Unfortunately it doesn't work in my code and also because I would like the search box to be separate from the map. The