This R package makes it easy to integrate and control the open-source JavaScript Leaflet software in R.
Questions tagged [r-leaflet]
499 questions
2
votes
2 answers
How to use clusterOptions in shinyapp leaflet map?
The following code works fine for common markers.
The clustering markers code works fine outside shiny.
How can I make it work in shiny.
library(leaflet)
library(shiny)
# TRUE, working simple version
simple <- TRUE # change to FALSE FOR non-working…

Ferroao
- 3,042
- 28
- 53
2
votes
1 answer
r-mapview legend name in multiple lines
I am trying to create a legend with multiple lines as shown in this leaflet example, but using the mapview package instead.
Following the above example, these cases work fine:
library(leaflet)
library(raster)
library(mapview)
p…

waiguoren
- 73
- 7
2
votes
1 answer
Function for create a zoom limit for don't show Map data not yet available
Is there any way to create a zoom limit function because despite the use of minZoom and maxZoomdoesn't work in:
leaflet() %>%
setView(lng = lng, lat = lat, zoom=17) %>%
addProviderTiles(providers$Esri.WorldImagery, options…

Leprechault
- 1,531
- 12
- 28
2
votes
5 answers
How do you exclude NA values from Leaflet legend?
Here's my data: https://paste.kodi.tv/omohuzawec
Updated data output from dput: redacted
I'm trying to replicate the following plot:
Here's the code I've used to replicate so far, the only thing I can't figure out is how to remove the NA from the…

myfatson
- 354
- 2
- 14
2
votes
1 answer
Problems embedding a leaflet map in a xaringan slide
I am trying to include a leaflet map in a xaringan presentation. There are several examples of this online, including in this presentation.
When my colleague tests the minimal example below they get an interactive map on slide 2, as expected. But…

mark
- 47
- 4
2
votes
0 answers
Getting Error: 'couldnt normalize path' when rendering mapview using leaflet package in R Shiny
I have build a Shiny App with one tab containing a map with points that can be analyzed in other tabs.
I build this map using leaflet, but since my version of the map does exactly the same as the mapview package, i want to incorporate this in the…

Stevestingray
- 399
- 2
- 12
2
votes
1 answer
How to resize large images in R Leaflet marker popups?
My code:
library(leaflet)
df <- as.data.frame(read.csv("arts.csv"))
file <- as.character(df$url)
leaflet() %>% addTiles()
%>% addMarkers(data = df, lng = ~lon, lat = ~lat,
popup = paste0("

Übel Yildmar
- 491
- 1
- 9
- 24
2
votes
1 answer
Interactive Leaflet with shiny - clearMarkers() and set new ones
I want to create an interactive leaflet map with Shiny. The creation works fine, but despite changes at selectInput() and clicking "go!" the old markers are not deleted and no new markers are set. Can you please help me?
Operating System:
Windows 10…

luthe
- 23
- 3
2
votes
0 answers
How do I implement map click events in r leaflet and reset the events to default?
I want to implement two map click events in my map, map_marker_click, and map_click. When I click on a marker on the map(using map_marker_click), I want the event to filter other related charts based on the id of the clicked marker. Using the…

brian
- 75
- 1
- 8
2
votes
1 answer
R - leaflet - highcharter tooltip (label)
After reading the solution of this question. I have tried to adapt the solution for the label (not the popup).
When I try the solution for the popup. It works…

Woza
- 205
- 3
- 9
2
votes
0 answers
How do I add a raster to a leaflet map in r that nicely covers the land, and doesn't have gaps?
I have a dataset of several thousand geographical points, each assigned a cluster (in my reproducible example below I simplify this to 8 points). I want to color an entire global map (only the landmass) using k nearest neighbours to these points. I…

mspooner
- 21
- 2
2
votes
1 answer
R code to save shiny.tag.list to html as the viewer->export->save as web page button does
I have a leaflet map that I have modified to have a special CSS for popups following the suggestions here. Now I want to save the result as an HTML web page. The resulting object is of type shiny.tag.list, which I can view with the viewer and export…

user3004015
- 617
- 1
- 7
- 14
2
votes
1 answer
How to add a leaflet pop up with conditional lines?
I've got this data frame:
country_groups <- structure(list(country_name = c("Australia", "Brazil", "Canada",
"China", "China", "China", "China", "China", "China", "China",
"China", "China", "China", "China", "China", "China", "European Patent…

MelaniaCB
- 427
- 5
- 16
2
votes
1 answer
Adding just an arbitrary image to a leaflet map
I am trying to use leaflet to show a smaller map than usual so I don't want to use the normal tiling system. I don't care about smooth zooming and loading higher resolution tiles when needed. Instead I am trying to add a raster image from an image…

OganM
- 2,543
- 16
- 33
2
votes
2 answers
R Leaflet PopupGraph - addPopupGraphs on map_marker_click
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…

Oscar Jnn
- 154
- 1
- 19