Questions tagged [r-leaflet]

This R package makes it easy to integrate and control the open-source JavaScript Leaflet software in R.

499 questions
4
votes
0 answers

Make Shiny Leaflet recognise a map created from an externally hosted JS file

I would like to use Shiny Leaflet to render an already existing leaflet map, but problems arise since the initial map is created from an externally hosted (rather complicated) JS file, which I do not have any control over. I can't seem to get the…
KarlJensen
  • 59
  • 5
4
votes
0 answers

R leaflet map, add button that expands on hover and shows some text

Expanding on an example from addEasyButton in RStudios leaflet package, I wonder if it is possible to create a button that automatically expands on hover to show some text? Something like the code below, but not via alert on click but via expand on…
TimSalabim
  • 5,604
  • 1
  • 25
  • 36
4
votes
1 answer

Show Polylines when mouse hover on Circles in leaflets in R

I have a flow Map - using leaflets in R library(leaflet) m <- leaflet(AM_Peak) %>% addTiles('http://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png', attribution='Map tiles by Stamen Design,
Prasanna Nandakumar
  • 4,295
  • 34
  • 63
4
votes
0 answers

R leaflet addRasterImage doesn't work at zooms higher than 18

I am wanting to use the addRasterImage() function to a leaflet object in R. However it only seems to work up-to a zoom level of 18. Please see the example below. library(raster) library(leaflet) library(magrittr) r <- raster(xmn=-2.8,…
h.l.m
  • 13,015
  • 22
  • 82
  • 169
4
votes
0 answers

R Shiny Leaflet: In-App Autorefresh but maintain view

I am working on a shinydashboard (using leaflet) that takes National Weather Service (NWS) Doppler radar data (through WMS), NWS hazard shapefile data, and NWS warning shapefile data. I have with it, a reactive poll that refreshes the radar,…
4
votes
0 answers

Cross-group clustering and overlay group control with leaflet in R?

I am trying to accomplish the equivalent of Ghybs Leaflet example found here, where selecting/deselecting an overlay group shows/hides the markers for a group and updates the clustering accordingly using R's leaflet package. There is a partial…
msoderstrom
  • 537
  • 1
  • 7
  • 14
3
votes
1 answer

Map background colour/transparency within R leaflet

I'm using a geojson file to produce a map with leaflet on R. I would like to change the background colour to the white, or make the background transparent if it is possible (this is actually really desired one). I have seen this and this. I am able…
fillo
  • 365
  • 1
  • 12
3
votes
1 answer

Markers not appearing on map using leaflet package in R - with basic example

I'm trying to use the leaflet package in R to produce an interactive map. Everything was working for me about a month ago, but now my map is appearing but I can't get the markers to appear. I tried using a simple example I found online but this has…
Stephanie
  • 31
  • 2
3
votes
1 answer

Adding a 'click' event to leaflet polygons via R

How can I add a mouse 'click' event to each polygon plotted on a leaflet map? I want to do this so I can then filter a separate widget based on data from the features (in this case WD21CD). --- output: html_document --- ```{r setup,…
Chris
  • 1,449
  • 1
  • 18
  • 39
3
votes
0 answers

Is there a way to differentiate the "draw a polygon" and "draw a marker" events with the "adddrawtoolbar" function in Rshiny?

Thanks to the leaflet.extras package it is easy to draw a polygon and/or a marker on a leaflet map as shown in the picture below. Once clicked on those buttons it is possible to trigger an event like this: observeEvent(input$map_draw_new_feature, {…
wanderzen
  • 119
  • 2
  • 12
3
votes
0 answers

change size of plots in htmltools::taglist R markdown

I am trying to use a loop in Rmarkdown that prints a leaflet map and plotly graph side by side (the loop iterates through vegetation types). I am having trouble getting the side-by-side to have the height and width I desire. In the joint plot I…
kingmidaz
  • 53
  • 6
3
votes
1 answer

Error in library(leaflet) : there is no package called ‘leaflet’

I wrote the docker file like this to deploy the shiny r application FROM rocker/r-base:latest\ RUN apt-get update && apt-get install -y --no-install-recommends \ sudo \ libcurl4-gnutls-dev \ libcairo2-dev \ libxt-dev \ libssl-dev…
JaNith RathNayaka
  • 101
  • 1
  • 2
  • 10
3
votes
1 answer

R Leaflet layers control with easybutton

I would like to use the leaflet easyButton plugin to control the layers shown instead of the built in layer controls. Unfortunately I do not know JS, and have spent several hours trying to make sense of the leafletJS documentation to find the…
jzadra
  • 4,012
  • 2
  • 26
  • 46
3
votes
3 answers

How to add a downloadButton in a popup?

I'm currently developing an R Shiny application where I'm mapping services providers on a map and when I click on a specific marker I have a popup with additional information and I would like to include a downloadButton in that popup. Unfortunately…
Nusta
  • 31
  • 2
3
votes
1 answer

Problem joining different SpatialPolygonsDataFrame objects in R

I have a shape file of towns in the north of Spain that I have to join into groups (municipalities or comarcas in Spanish). I've used st_union from the sf package to join them successfully (and each one is their own SpatialPolygonsDataFrame object…
Ainhoa
  • 191
  • 7