Questions tagged [r-leaflet]
This R package makes it easy to integrate and control the open-source JavaScript Leaflet software in R.
r-leaflet
76
questions
31
votes
5
answers
29k
views
How Do I connect two coordinates with a line using Leaflet in R
I am trying to use Leaflet package in R to draw a amp and connect the markers given the latitude and longitude information in the table below.
| Observation | InitialLat | InitialLong | NewLat ...
29
votes
1
answer
19k
views
Marker mouse click event in R leaflet for shiny
How can I receive a mouse click event on a marker in a leaflet map in R? I'm using the RStudio/leaflet and running through Shiny.
I'd like to get the value of a marker (e.g., ID) and use that to ...
19
votes
2
answers
32k
views
R: Add title to Leaflet map
I'd like to add a title to the whole map (different from the legend title: addLegend(..., title = "", ...): by "title", I mean an overlaid map component that stays in place while the map is moved (...
6
votes
2
answers
9k
views
How to save a leaflet map in Shiny
Following on from this question, I am looking to save and download a leaflet map as a png or jpeg image. I have the following code but I keep getting an error.
ui <- fluidPage(
leafletOutput("...
8
votes
1
answer
3k
views
Select multiple items using map_click in leaflet, linked to selectizeInput() in shiny app (R)
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 ...
10
votes
1
answer
544
views
Load Quarto html map data from json for Leaflet map generated in R
I have created a Quarto blog post which contains many leaflet maps, generated in R. As the data for each map is embedded within the html file, the file itself is very large. This is causing problems ...
4
votes
1
answer
2k
views
How to make appearance of clustered icon related to statistics of the children?
I'd like to customize appearance of clustered markers in Leaflet/Shiny application based on sum of an attribute of child markers.
It is similar to this problem, which makes icon color of clusters ...
16
votes
1
answer
13k
views
How to add labels on top of polygons in leaflet
I am working with the leaflet R package. I have a zoning system made of polygons and I'd like to lay their IDs on top of them. Below is an illustration (with another software) of my objective.
...
14
votes
3
answers
8k
views
Reverse order in R leaflet continuous legend
I am trying to reverse the value display of my leaflet legend in R. This post covers categorical data, but I am working with continuous data. Here's a toy example:
map <- leaflet() %>% ...
12
votes
1
answer
6k
views
Shiny - how to highlight an object on a leaflet map when selecting a record in a datatable?
Is there a way to highlight a marker or polyline on a leaflet map when selecting (clicking on) the corresponding record in a datatable?
I looked at these questions/threads:
selecting a marker on ...
10
votes
1
answer
5k
views
How can I make my Shiny leafletOutput have height="100%" while inside a navbarPage?
I'm working on a Shiny App that uses the Leaflet package. Without a navigation menu, I am able to make the LeafletOutput have 100% height by using leafletOutput('map', height='100%').
The problem is ...
6
votes
5
answers
7k
views
Flow map(Travel Path) Using Lat and Long in R
I am trying to plot flow map (for singapore) . I have Entry(Lat,Long) and Exit (Lat,long). I am trying to map the flow from entry to exit in singapore map.
structure(list(token_id = c(1.12374e+19, 1....
6
votes
2
answers
14k
views
Draw a map of a specific country with leaflet
I would like to use the package leaflet with R to draw a map of a specific countries such as Italy, Spain, etc.
I checked the basic examples with the function setView() and I tried to give a vector ...
4
votes
1
answer
900
views
Leaflet in another tab not updated with leafletproxy before visiting tab
I am making an application using shiny that uses multiple tabs. On one tab (not the starting tab) I display a leaflet map, which is controlled by widgets on different tabs.
The issue is that if I ...
2
votes
1
answer
1k
views
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 ...