All Questions

Tagged with
Filter by
Sorted by
Tagged with
54
votes
6answers
18k 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'...
39
votes
6answers
25k views

Saving leaflet output as html

I am using RStudio to create some some leaflet images. I would like to be able to save the output as an HTML so that it can be emailed and others can view it. Below is some sample R code which was ...
39
votes
1answer
26k views

How to save Leaflet in R map as png or jpg file?

I'm using Leaflet package to create maps in R. It works perfectly. I can export maps in R with simply Export, but I need to export maps from script in R. My simple code is: png("test_png.png") (m <...
24
votes
2answers
13k 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 ...
23
votes
1answer
9k views

R and Leaflet: How to arrange label text across multiple lines

Suppose you have the following data frame: cities = data.frame( name = c('Madrid','Barcelona','Sevilla'), country = c('Spain','Spain','Spain'), region = c('Comunidad ...
22
votes
5answers
20k 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 ...
19
votes
3answers
7k views

Adjust size of leaflet map in rmarkdown html

I'd like to change the height and width of leaflet map outputs in html document. Is there a simple way to do this in R markdown without getting into whole CSS business? ```{r} library(leaflet) ...
18
votes
2answers
10k views

Popup when hover with leaflet in R?

My leaflet map looks something like this: library(sp) library(leaflet) circleFun <- function(center = c(0,0),diameter = 1, npoints = 100){ r = diameter / 2 tt <- seq(0,2*pi,length.out = ...
16
votes
1answer
8k views

R leaflet zoomControl option

I'm building a map tool in R using leaflet, and I would like to restrict the zoom to a certain area, but the setMaxBounds function doesn't seem to have any effect. library(dplyr) library(leaflet) ...
16
votes
2answers
7k 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 ...
16
votes
1answer
5k views

Is it possible to update polygon fill in leaflet for shiny without recreating the map object

In leaflet, I would normally create a map with: server.R shinyServer(function(input, output, session) { url <- "custommapboxurl" attrib <- "Maps by http://www.mapbox.com/Mapbox" ... ...
15
votes
5answers
33k views

Change color of leaflet marker

Is there anyway to change the color of leaflet marker base on the value of some variable. In the following map, for example, I wish to assign marker color based on mag variable: library(leaflet) ...
15
votes
2answers
5k 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 <- ...
15
votes
1answer
921 views

Is it possible to switch between multiple legends when switching between base groups?

I am visualizing some vector data using leaflet in r which has multiple non-spatial variables that a user might be interested in. I want to allow the user to select one variable that will determine ...
14
votes
1answer
6k 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 ...

15 30 50 per page
1
2 3 4 5
…
105