Skip to main content

All Questions

Tagged with
49 votes
6 answers
41k 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 ...
h.l.m's user avatar
  • 13.3k
26 votes
4 answers
15k 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) ...
Ken's user avatar
  • 893
8 votes
4 answers
4k views

embed R leaflet map in wordpress

I have just created a simple interactive map using leaflet package in R. Something like this leaflet() %>% addTiles() Now I would like to embed it in my wordpress website. I clicked on the ...
Jacopo's user avatar
  • 163
7 votes
1 answer
2k views

Center leaflet in a rmarkdown document

I want to create an html document with a centered leaflet widget inside it. --- title: "Exemple" author: "Antoine Bichat" date: "31/08/2018" output: html_document --- ```{r leaflet, fig.align="...
abichat's user avatar
  • 2,406
6 votes
1 answer
15k views

Customizing leaflet popup in R

I am using RStudio to create a choropleth leaflet map. I have Country and Url as an attribute in the shapefile that I imported to R. I wish to show the Country name and URL as a hyperlink within the ...
Viv's user avatar
  • 185
5 votes
1 answer
444 views

Import data from a leaflet map as an sf object in R

I want to import data as an sf object in R from a leaflet map. The map is this site: https://erickgn.github.io/mapafc/ I also have the HTML from the map as following:https://raw.githubusercontent.com/...
Maria Mittelbach's user avatar
4 votes
2 answers
5k views

R leaflet - Show/Hide addControl() element with group layers

I have a leaflet map which uses a custom legend using HTML and added using the addControl function (following: Leaflet Legend for Custom Markers in R). However, I only want the legend to show when ...
Tom Newton's user avatar
4 votes
1 answer
824 views

Customizing Leaflet Map Icons in R

I started to learn how to use the search features in leaflet maps - below is a leaflet map which allows you to search for a city (i.e. single search term): library(leaflet) library(leaflet.extras) ...
stats_noob's user avatar
  • 5,689
3 votes
2 answers
3k views

Shiny - Control Widgets Inside Leaflet Map

I have a simple shiny-app with just a dropdown listing districts of Afghanistan and a leaflet map of the same. The shape file can be accessed at this link - using AFG_adm2.shp from http://www.gadm....
ProgSnob's user avatar
  • 483
3 votes
1 answer
4k views

labels in leaflet r with HTML tags

All good souls, help needed. I am creating a leaflet map and cannot resolve a strange issue with labels. I created labels with few variables and the labels render ok if the first variable is numeric, ...
Slav's user avatar
  • 479
3 votes
1 answer
3k views

Shiny R: How to make a Leaflet legend horizontal

I'm trying to make a horizontal legend in a Shiny app with a Leaflet map. I can change the display to display: flex; using CSS which makes the legend horizontal but what I'm aiming at is something ...
Ziemowit Bućko's user avatar
3 votes
1 answer
1k views

Is there a way to make leaflet map popup responsive on R?

I use this R code (data was changed) to create an html file that I keep on a server: library(leaflet) leaflet() %>% addProviderTiles(providers$OpenStreetMap) %>% setView(lng=2....
E. Taro's user avatar
  • 41
3 votes
1 answer
1k views

How do I output leaflet map from R into format where I can edit using Leaflet commands?

I have some experience with using R for data manipulation and making maps with GIS software, so I just tried to make my first Leaflet map using the Leaflet for R package. Working off of tutorials I've ...
mmalloy's user avatar
  • 74
3 votes
3 answers
3k views

Placing leaflet controls side-by-side instead of vertically stacked in R/Shiny with HTML/CSS

What I want to do is pretty simple: I want my leaflet controls to be aligned side-by-side in rows rather than vertically as columns (as leaflet automatically does). Here is some short example code: ...
Lauren's user avatar
  • 1,075
2 votes
3 answers
2k views

Overlay Static Images on R Leaflet htmlwidget

It it possible to overlay an image to R leaflet maps - or perhaps in the leaflet html - that would stay fixed overtop the map itself? That is, the image wouldn't be rendered on the map itself, but ...
HGupta's user avatar
  • 127

15 30 50 per page