All Questions
828
questions
72
votes
8
answers
27k
views
How to get Leaflet for R use 100% of Shiny dashboard height
I am in the process of creating a Shiny dashboard application, where the dashboard body is supposed to show some maps. So far no problem to get the map expand over the entire width of the body, but it'...
19
votes
1
answer
11k
views
How to get the zoom level from the leaflet map in R/shiny?
I create a map using leaflet package in Shiny which have a selectInput to allow user to select from a site list. The site list also adds into leaflet as markers.
When user selects a new site, I want ...
18
votes
2
answers
9k
views
How to display (advanced) customed popups for leaflet in Shiny?
I am using R shiny to build web applications, and some of them are leveraging the great leaflet features.
I would like to create a customed and advanced popup, but I do not know how to proceed.
You ...
17
votes
1
answer
14k
views
shiny leaflet ploygon click event
I have a map called business which is downloaded from natural earth website. What I am doing here is I created a basic Map output which shows the map. I am mainly using two columns which are admin(...
16
votes
1
answer
10k
views
Creating legend with circles leaflet R
I'm trying to create a leaflet map with points sized by a variable. Is it possible to create a legend with different sized circles representing the different variable values? I found another post ...
16
votes
2
answers
10k
views
Multiple markers on same coordinate
When plotting out markers on a interactive worlmap from the r package leaflet data with exactly the same coordinates will overlap each other.
See the example below:
library(leaflet)
Data <- ...
16
votes
1
answer
8k
views
Changing Leaflet map according to input without redrawing
I'm wondering how I can change Shiny and Leaflet to plot points according to the change in input without redrawing the whole map.
The code i'm using is:
library(leaflet)
library(shiny)
library(dplyr)
...
16
votes
1
answer
7k
views
Save leaflet map in Shiny
I have created a leaflet map in a Shiny application. Now I need a download button, so that the user can download the currently shown map including all markers, polygons etc. as a pdf file.
I have ...
15
votes
1
answer
6k
views
Click event on Leaflet tile map in Shiny
Is it possible to get the lat long from a click event in leaflet/shiny (in R) from the tile map? (i.e. NOT from any loaded markers, polygons etc). Just to show positional (lat/long) info i guess.
I ...
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 ...
12
votes
2
answers
2k
views
Cache or pre render leaflet map in shiny app
I am trying to map ~8000 polygons using leaflet and run into performance issues.
As I am using the map within a shiny app, I was wondering if its possible to somehow cache or pre-render the map.
Note ...
12
votes
1
answer
5k
views
How to add a text on a leaflet map?
Each day I need to draw a path on a map and add a text like 4, 5 or 8 min. indicating how long it takes by car from the starting point to the destination (see the figure below). I thought it would be ...
11
votes
3
answers
14k
views
Change the default position of zoom control in leaflet map of Shiny app
I am using Shiny app to create leaflet map, but want to change the default position of zoom control from topleft to topright.
R leaflet package sets the default position as topleft in the source ...
11
votes
1
answer
10k
views
Leaflet for R: How to customize the coloring of clusters?
How do I customize the coloring of the addMarkers function in the leaflet package for R?
The default coloring for clusters is:
1-10 Green
11-100 Yellow
100+ Red
I'd like to change the ranges and ...
11
votes
1
answer
1k
views
How to save a leaflet map with drawn shapes/points on it in Shiny?
This question is a follow-up to the questions How to save a leaflet map in Shiny, and Save leaflet map in Shiny.
I add a toolbar to draw shapes/points on the map that is addDrawToolbar in the ...