Skip to main content

All Questions

Tagged with
0 votes
1 answer
83 views

Having google search images as leaflet popup

Recently I have been working with the package 'leaflet' in R. I have already created my interactive map and so on, but I would prefer to style it up a bit. My program recieves a list of Cities ...
user23004030's user avatar
0 votes
0 answers
40 views

When i knit my R markdown it doesn't show leaflet after running showing a Wordcloud

Basically when I knit the R markdown the file shows just the Wordcloud, and not the leaflet map. If I invert the order everything works fine. Any suggestion? My chunks here: library(tidytext) library(...
Corvinus's user avatar
-1 votes
1 answer
26 views

Lag in HTML Outputs within R

I found this post on stackoverflow to make an interactive map in R (second answer): Search button for Leaflet R map? library(leaflet) library(inlmisc) df = read.csv(textConnection( 'Name, Lat, Long &...
stats_noob's user avatar
  • 5,689
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
1 vote
1 answer
196 views

Adding "Breaks" in "htmlescape"

I am following this tutorial here (https://rstudio.github.io/leaflet/popups.html): library(htmltools) library(leaflet) df <- read.csv(textConnection( "Name,Lat,Long Samurai Noodle,47....
stats_noob's user avatar
  • 5,689
1 vote
1 answer
27 views

Is "knitr" required for certain outputs in R?

I am trying to follow this post on stackoverflow (R Leaflet: Add a Range Slider to Filter Markers without Shiny). I copy and pasted the code below: library( crosstalk ) library( leaflet ) library( ...
stats_noob's user avatar
  • 5,689
1 vote
1 answer
594 views

Making a leaflet map fullscreen in an RShiny dashboard

I'm working on creating an RShiny dashboard with a leaflet map; I want my map to be fullscreen, but I can't quite seem to get the borders/margins to go away. I have tried the solutions offered in a ...
metamorporpoise's user avatar
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
1 vote
0 answers
126 views

Exporting R-leaflet applications as html with full source code

since updating my R verison, R-leaflet applications exported (e.g via saveWidget(map, "map.html", selfcontained = T) don't show the full source code any more but instead reverence different ...
ClaraH's user avatar
  • 11
0 votes
1 answer
106 views

How to pass a list of urls contained in a dataframe column into a leaflet map?

I want to make a map using leaflet so that the points in the map have popup notes. Each popup will have a clickable link to redirect to an Internet page. The URLs that will be inserted in such popups ...
mad10les's user avatar
  • 152
1 vote
1 answer
592 views

How to make a click on R Leaflet state go to a url?

I'd like to build a map where when a state is clicked, it will open a hyperlink url in a new tab. I've been searching around for answers and can't quite get it to work for r leaflet. I believe I need ...
Tim's user avatar
  • 71
0 votes
2 answers
457 views

RShiny: Trying to centre my leaflet but I want the legend to stay left justified

I've searched around google and stack overflow but haven't found this question asked before. Basically I want to centre my leafletOutput and have done so with this code: UI <-fluidPage( fluidRow(...
cdbezz's user avatar
  • 43
1 vote
1 answer
445 views

HTML code working in r leaflet for popups but not for labels

So I'm working with leaflet in R Studio and I'm trying to include some HTML code into the popups and labels of the icons. I just can't figure out why it's working for the popups but not the labels. ...
cdbezz's user avatar
  • 43
0 votes
1 answer
246 views

R: Using browsable() in leaflet resulting in a smaller screen height

I build a leaflet in R like this: my_leaflet <- my_data %>% leaflet (options = leafletOptions( - ) %>^% addProvidersTiles( - ) setView( - ) %>% addMarkers ( -- ) %>% addCircleMarkers( - ...
Luk7's user avatar
  • 33
0 votes
0 answers
68 views

How do I get includeHTML to work inside multiple TabPanels?

I'm trying to include 2 HTML files in different tabPanel separations for a Shiny app. I do that, and one of the html files renders properly but the other one's widgets just do not display. Anyone know ...
Armin Thomas's user avatar
1 vote
0 answers
215 views

R Leaflet - How to combine text and figure in popup?

I would like to combine text and a figure in a Leaflet Popup. I saw this on a website of Deutsche Bahn: Multi-Object-Popup Website: strecken.info For me it would be sufficient to combine two of these ...
Lars Möller's user avatar
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
2 votes
2 answers
1k views

Leaflet maps not appearing in tabbed HTML document output from Rmarkdown

I've used R Markdown to create a HTML document with tabbed sections and each tab should include one Leaflet map. When I run the code, the Leaflet maps only appear in the first two tabs of the HTML ...
RaBe's user avatar
  • 53
0 votes
1 answer
727 views

Creating label in leaflet map using htmltools produces tiny label

Creating a leaflet map. First step, specify the label. The code used on leaflet github puts %>% lapply(htmltool::HTML) after the sprintf() function. However, making it is creating the label as ...
Mason's user avatar
  • 3
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
0 votes
1 answer
2k views

Saving a leaflet map as an html file

I've created a leaflet map of corn yield in Kansas using USDA NASS data. The problem I'm running into is exporting the leaflet into an html file using the command: htmlwidgets::saveWidget(...
gm007's user avatar
  • 557
1 vote
2 answers
3k views

Post local image into a popup using leaflet and R

I've been trying like crazy to add local images (as in image files in my computer) into my leaflet map using R. I have plotted around 500 coordinates analyzing some images and I wish to show that ...
Bernardo's user avatar
  • 498
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
0 votes
1 answer
2k views

Saving R leaflet-shiny interactive map as HTML executable file

Is there a way to save a leaflet-shiny script as a single executable HTML file? For example for a leaflet script you can use: saveWidget(map, file = "mymap.html") Then the html file will contain all ...
user avatar
1 vote
0 answers
359 views

R Leaflet HTML Formatting

Using Labels along with addCircleMarkers I want to customize the format of labels displayed. This is achieved with HTML as follows. labels <- sprintf( "<div style = 'width: 170px; word-wrap: ...
Sada93's user avatar
  • 2,835
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
0 votes
1 answer
429 views

r - Overlay fileInput on leaflet in shiny

I have a leaflet map in a shiny app. It takes a file from a user and plots that data. It's kind of ugly right now, though. I'd really like to have the fileInput to be overlaid on the leaflet map. In ...
Heliornis's user avatar
  • 391
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
2 votes
1 answer
2k views

Image in Leaflet marker popup in Shiny

When making maps in R using Leaflet I often use images in the marker popups by putting an html line. I would like to make a leaflet map in Shiny that allows the user to select photos to go into the ...
LAD's user avatar
  • 151
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
1 vote
0 answers
277 views

R leaflet display the polygon label by default

I am new to the leaflet package. I am trying to draw two types of polygons and let the user select them and see the borders. These polygons have labels and I want to display them by default. At the ...
Paba's user avatar
  • 1,115
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
2 votes
1 answer
2k views

Leaflet map won't render in browser

I have a map using Leaflet which works in the html output of r markdown, but the map won't render when I open the html in Google or IE. Ggmap works fine, but I'd prefer an interactive map. Any ideas? ...
Zeus's user avatar
  • 1,560
1 vote
1 answer
1k views

R: Make interactive maps that can be exported to HTML

I have been working with Leaflet for creating cool interactive maps in R. However, I cannot export the maps, as the background map ends up being grey after export. library(leaflet) library(...
Esben Eickhardt's user avatar
2 votes
2 answers
2k views

R leaflet - cannot export map

I plot a route on a map using R and leaflet : ct <- read.csv("fl1.csv", stringsAsFactors=FALSE) m <- leaflet(ct, incl.data=TRUE) %>% addTiles() m %>% addPolylines(~longitude, ~latitude, ...
erculeo's user avatar
  • 31
0 votes
0 answers
231 views

Make a local R leaflet html map connect to a dynamic online dataset

I'm working on a leaflet map in R. The coordinates presenting in this map is saved in a google sheet and I'm using read.csv to import the data into R. Here is my sample code below: geolocation <- ...
Lambo's user avatar
  • 887
1 vote
1 answer
2k views

Put Leaflet controls outside of map div in Shiny environment

Is it possible to move Leaflet controls outside of the map div in a Shiny environment? Example: From the following code: library(shiny) library(leaflet) shinyApp( ui <- fluidPage( ...
Lauren's user avatar
  • 1,075
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
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
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
1 vote
1 answer
315 views

Why do Leaflet and DT widgets show blank screen if they are saved as HTML in R?

I'm on a Linux environment, and I'd like to make standalone HTML widgets in R using Leaflet and DT, and generating the HTML with htmlwidgets plugin. The problem is that when I try to open these ...
Atka's user avatar
  • 11
1 vote
1 answer
792 views

image not displaying in html string for addControl() from leaflet in R

I have the following code myicon <- makeIcon( iconUrl = "myicon.ico" ) html_legend <- "<img src='myicon.ico'>hey<br/>" map_leaflet <- leaflet() %>% addTiles() %>% ...
tuttifolies's user avatar
  • 1,427
2 votes
1 answer
1k views

leaflet marker not displaying in certain contexts

I am using the leaflet htmlwidget implementation to draw a web-based map using R. I was looking for a specific marker, couldn't find it, and realized it wasn't being displayed at all. However, when I ...
peopletrees's user avatar
1 vote
1 answer
2k views

R, leaflet package, Passing a character vector of HTML tags to popups?

I'm trying to emulate the first example on https://rstudio.github.io/leaflet/popups.html but with a vector of html tags rather than one. Example on https://rstudio.github.io/leaflet/popups.html: ...
Greenisagoodcolor's user avatar
0 votes
1 answer
454 views

Leaflet for R: CSS defined in header is not working inside leafletProxy

I'm using leaflet and shiny to create a small map with clusters. For that, I need to change the colours of the clusters, which I've done using code from a reply to this question. However, I cannot get ...
Bertel's user avatar
  • 121
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
1 vote
1 answer
358 views

Edit map with "R for leaflet"

I have a script which allows me to generate a map with with "R for leaflet" : library(htmlwidgets) library(raster) library(leaflet) # PATHS TO INPUT / OUTPUT FILES projectPath = "path" #imgPath = ...
KingOfBabu's user avatar
0 votes
1 answer
122 views

Rapache & R for leaflet

I'm trying to make a webpage with Rapache and "Leaflet for R". The main reason I did install Rapache is to use R inside of a html page (with brew). But, I cant figure out how to return my map inside ...
KingOfBabu's user avatar
1 vote
1 answer
648 views

Using leaflet on shiny with HTML ui

I am trying to plot a dynamic map with leaflet on a shiny app using an HTML interface but when i get the map it is static When doing it the simple way using only the R interface it works fine Is there ...
eliavs's user avatar
  • 2,346

15 30 50 per page