Questions tagged [r-leaflet]

This R package makes it easy to integrate and control the open-source JavaScript Leaflet software in R.

499 questions
3
votes
1 answer

Creating a Leaflet map with custom labels in R

I would like to visualize my data using a world map in R, where labels are to be added at certain points (given coordinates). The labels should be some 3D-rectangles with heights proportional to the value from data table. I would use the R package…
astrsk
  • 375
  • 6
  • 20
3
votes
3 answers

Leaflet map preventing browser scroll

Whenever the mouse pointer is hovering over a leaflet map, the browser does not scroll up or down. This happens even when I affix minZoom and maxZoom to an equal value. Is there a solution to this? php.poverty.map.2009 <- leaflet(options =…
Jim O.
  • 1,091
  • 12
  • 31
3
votes
1 answer

Combine leaflet and markdown in loop

This question shows how to loop over/apply leaflet objects within a markdown file. I'd like to do a similar thing, though I'd like to add additional markdown content. --- title: "Test" output: html_document --- ```{r setup,…
gregmacfarlane
  • 2,121
  • 3
  • 24
  • 53
3
votes
1 answer

How can I make my two R leaflet maps synchronise with each other?

I have had some nice success implementing Leaflet package in R for some data. I have also managed to put two maps side by side as a lattice, and as a sync. I have two issues: 1) Sync...does not sync the maps at all I am using Mapview and Raster to…
mojo3340
  • 534
  • 1
  • 6
  • 27
3
votes
3 answers

Why does leaflet output grey map?

I run simple examples of leaflet package in R like: library(leaflet) library(ggmap) >somePlace <-ggmap::geocode("Vienna") Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Vienna&sensor=false >somePlace lon …
Patrik_P
  • 3,066
  • 3
  • 22
  • 39
3
votes
0 answers

Leaflet in R not working with Proxy settings

I am using following code segment to prepare a graph.. library(leaflet) df = read.csv('Locations.csv') nclus = 3 set.seed(123) res = kmeans(df[,c('Lat','Lon')], centers = nclus, ) df['center'] = res$cluster pal <- colorFactor(rainbow(nclus), domain…
vrajs5
  • 4,066
  • 1
  • 27
  • 44
2
votes
1 answer

leafletProxy in modalDialog is not updated

I have a quite simple application where I try to render a leaflet map inside a modalDialog. Inside this modalDialog, some inputs allow the user to customize the map. It works pretty well the first time the modalDialog is opened, but as soon as it is…
Bambs
  • 545
  • 4
  • 14
2
votes
1 answer

Legend Disappearing on Geographic Map of North Carolina?

I am working with the R programming language. Using this built-in map of North Carolina, I generated 3 random variables (income, number of kids, weight) and then created maps (with the "leaflet" library) for this data (via a loop): library(sf) …
stats_noob
  • 5,401
  • 4
  • 27
  • 83
2
votes
0 answers

Customize arrows labels in addFlows

A am playing with arrows in leaflet in R and i found function addFlows in leaflet.minicharts library. It is exacly what I need, but I have problem to plot correct information on popup which we get after clicking on each arrow. As you can see on the…
tomsu
  • 371
  • 2
  • 16
2
votes
1 answer

Raster output from rasterized sf points does not align with points

I am trying to rasterize some points and am getting a mismatch between the points and the rasters despite the crs being the same. If I convert the raster to polygons it lines up perfectly with the sf points data, but I can't figure out why the…
Blaiso
  • 165
  • 9
2
votes
0 answers

Trying to get leaflet plots to show on PDR render of RMarkdown

I would like to render a rmarkdown as pdf that as some html (leaflet) in it. Here is the YAML header: date: '2022-07-29' output: pdf_document always_allow_html: true My markdown would not render as pdf unless I included the "always_allow_html".…
2
votes
1 answer

Interaction between reactable and Leaflet in shiny app (crosstalk, leafletproxy)

My app has a leaflet object and a reactable object which interact via crosstalk. When the user select a record from the table (using the checkbox), I want the app to add only the corresponding marker (using a different icon) and completely remove…
António
  • 43
  • 6
2
votes
1 answer

Programatically trigger marker mouse click event in R leaflet for shiny

My question is identical to this one: Trigger marker mouse click event in R leaflet for shiny but I don't have enough rep to add a comment, and the edit queue is 'full' so I can't add my thoughts to the original question. Not sure if this goes…
2
votes
1 answer

Leaflet Awesome Markers icon isn't display in R

This is my data set: start_stations <- data.frame( station = c("StreeterDr", "MichiganAve", "WellsSt"), lat = c(41.89228, 41.90096, 41.91213), lng = c(-87.61204,-87.62378,-87.63466), n = c(23000, 56780, 34520) ) This is the code…
KalsaraL
  • 39
  • 7
2
votes
1 answer

leafletProxy not working in shinyDashboard

leafletProxy doesn't seem to be functional within shinyDashboard. See working example below where choosing different letters should change the circle color. Any insight appreciated. Github issue created here:…
mad2e2
  • 33
  • 4