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
1 answer
Leaflet drawToolbar with leafletProxy in R Shiny
I like to add and remove a drawtoolbar when toggling a button. But it does not work. Maybe a bug related to https://github.com/bhaskarvk/leaflet.extras/issues/148 or is something wrong with my…

needRhelp
- 2,948
- 2
- 24
- 48
2
votes
0 answers
mapedit change color and opacity
I have a simple app that allows a user to draw a feature.
How can I also allow the user to select the fill colour and opacity by providing a hex code.
Reproducible example:
library(mapedit)
library(mapview)
library(shiny)
library(colourpicker)
ui…

sebdalgarno
- 2,929
- 12
- 28
2
votes
1 answer
Designing hover text for leaflet with HTML - how to insert break for each comma
I'm using leaflet to map observations. I'm also using htmltools to format the hover text that shows variables of each observation.
The problem is, I want the variable hobbies which contains many strings to show on each line. each hobby is separated…

Yeshyyy
- 669
- 6
- 21
2
votes
0 answers
Add static view of Leaflet in Rmarkdown pdf output
I have an RMarkdown that I'd like to knit to HTML and PDF. The notebook contains a LeafLet map that I can see fine in the HTML preview but it's completely ignored in the PDF output. By this I mean, the code gets executed but no map is displayed…

Daniel
- 462
- 3
- 13
2
votes
1 answer
Leaflet Map with Cities in English in R
I am working on a Shiny application where I am required to plot positions of ships on a map. Currently I am using leaflet and the OpenSeaMap as the base layer on which I am plotting the positions (addProviderTiles(providers$OpenSeaMap)). However,…

Dhiraj
- 1,650
- 1
- 18
- 44
2
votes
1 answer
R leaflet - How to wait for `map_shape_click` only
Using leaflet mouse-events, a click on a shapefile, also triggers a click on the map, so the green lines in the example are drawn immediately.
How can I wait for a click on one of the shapefiles, to remove the clicked Line and ignore map-clicks for…

SeGa
- 9,454
- 3
- 31
- 70
2
votes
1 answer
Leaflet for R: Display several data rows in popup
While trying to map some quantitative data with leafletin R, I manage to place pie-charts with leaflet.minichartson the map, like in the following example:
### data ###
d <- structure(list(
area_name = c("Alscheid", "Alzingen", "Angelsberg",…

Peter
- 77
- 9
2
votes
1 answer
How do I remove a selection made using Shiny and mapedit by clicking again on the feature?
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…

Jody Biggs
- 35
- 1
- 5
2
votes
1 answer
Shiny app runs significantly slower on Shiny Servers than it does locally
This is the source code of my Shiny app plotting polygons of more than 350 towns in Taiwan whenever there's any changed input from UI. Values of towns would change every time according to the inputs so there's little opportunity to do leafletProxy.…

ytu
- 1,822
- 3
- 19
- 42
2
votes
0 answers
How to assign a specific size to the marker in leaflet R
I am trying to plot spatial data using leaflet package in R. i want to change the location marker's default size. How can i assign a particular size to the marker in R leaflet package when i am using addAwesomeMarkers option

user8186863
- 21
- 4
2
votes
1 answer
How to connect leaflet map clicks (events) with plot creation in a shiny app
Hello I am creating an environmental shiny app in which I want to use a leaflet map to create some simple plots based on openair package(https://rpubs.com/NateByers/Openair).
Aq_measurements() general form
AQ<- (aq_measurements(country = “country”,…

firmo23
- 7,490
- 2
- 38
- 114
2
votes
2 answers
Leaflet.minichart using R in jupyter notebook
Background
I'm no familiar with Javascript language, then I have tried the package leaflet.minicart using R inside the Jupyter notebook.
Writting the example code as follows:
library(leaflet)
m <- leaflet() %>%
addTiles() %>% # Add default…

Han Zhengzu
- 3,694
- 7
- 44
- 94
2
votes
1 answer
Change leaflet heatmap options in shiny
I am using leaflet-heat.js plugin for leaflet.
The only way that I could make it work, was through the rCharts library.
R shiny leaflet javascript addons - heatmap
The heatmap displays correctly, but I cannot change the heatmap options.
In addition,…

fhaidacher
- 123
- 9
2
votes
1 answer
Use R Leaflet To Interact With Leaflet Map Drawn From JavaScript API
A few weeks ago i discovered the great site, https://windy.com, which offers a free API to include the map in your own webpage (see https://api.windy.com).
I would like to include this map as a base layer/provider tile in a leaflet to be featured…

JesperHansen
- 437
- 1
- 4
- 16
2
votes
1 answer
How to show label over markers on leaflet in R?
This question is related to this one and this one.
There are two solutions given in JavaScript.
I don't know JS at all and wanted to know how these solutions could be adapted to be used with the R package leaflet.

F. Privé
- 11,423
- 2
- 27
- 78