All Questions
51
questions
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 ...
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)
...
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 ...
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="...
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 ...
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/...
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 ...
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)
...
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....
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, ...
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 ...
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....
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 ...
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:
...
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 ...