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

Why have I lost ability to use mapshot

I've been using mapshot a lot to send interactive maps of data but recently, although I can make the maps I want with mapview, I can't save them. Example: map<- mapview(mapdata, zcol = "columnofinterest", burst = TRUE) mapshot(map, url =…
Sissiboon
  • 41
  • 2
4
votes
1 answer

converting an sf object into raster

Basically, I am trying to convert an sf object into a raster file, to be plotted with leaflet. the sf object look like this: Simple feature collection with 33901 features and 1 field geometry type: POINT dimension: XY bbox: xmin:…
Riccardo
  • 41
  • 1
  • 2
4
votes
1 answer

Leaflet in another tab not updated with leafletproxy before visiting tab

I am making an application using shiny that uses multiple tabs. On one tab (not the starting tab) I display a leaflet map, which is controlled by widgets on different tabs. The issue is that if I change the inputs on one tab, without visiting the…
David
  • 9,216
  • 4
  • 45
  • 78
4
votes
2 answers

R - leaflet - highcharter tooltip

I want to include a highcharter plot in my leaflet popup. With help from this post Iam able to include a sparkline plot. However, due to my lack of html skills I dont know how to modify the code to work with highcharter. This answer on SO (example…
Pierre
  • 671
  • 8
  • 25
4
votes
0 answers

R Shiny addPolygons fails in leafletproxy but works in leaflet()

I am trying to create a leaflet map that adds and removes a polygon layer (SpatialDataFrame) based on changing user inputs into a flexdashboard Shiny App. The geometry of the polygons (4201 polygons) remains constant, but as user makes changes to…
DarwinsBeard
  • 527
  • 4
  • 16
4
votes
1 answer

"Wasn't able to determine range of domain" for ColorNumeric

I'm trying to create a choropleth map in R. I've merged my shapefiles and data files. I'm trying to create a palette for the different colours I want my data to display in on my choropleth. When I use the colorNumeric function it returns an error…
A.Wilcock
  • 41
  • 1
  • 5
4
votes
0 answers

remove mapedit features programmatically

With mapedit it is possible to clear drawn features using the 'trash' icon built into the drawbar UI. It is also possible to clear features associated with the leaflet map using clearMarkers() and leafletProxy(), as laid out in this issue. However,…
sebdalgarno
  • 2,929
  • 12
  • 28
4
votes
1 answer

Click on leaflet marker and get info

Based on the comments below I've explicitly broken out lat/long in the spatial data frame. Added addCircleMarkers( ~ longitude, ~ latitude) Added observeEvent(input$map_marker_click, { p <- input$map_marker_click print(p) }) Yet,…
ixodid
  • 2,180
  • 1
  • 19
  • 46
4
votes
1 answer

Filtering leaflet map data in shiny

I'm having trouble setting up this shiny with a leaflet map. My original post had two questions and it was suggested I should start a new post to address my second issue: how do I get the map to show my updated data after I have filtered by speed;…
val
  • 1,629
  • 1
  • 30
  • 56
4
votes
1 answer

Extracting data from a WMS-layer

I am trying to extract data from a WMS-layer. As an example, I would like to analyse whether or not a Natura2000 area is touched by my area and what the specifics are of the Natura2000 area. The WMS-layer of the Natura2000 area can be found at:…
Ashoka
  • 139
  • 1
  • 6
4
votes
1 answer

How to assign popup on map polygon that corresponds with the country R leaflet

I am trying to write a script that would allow people to click on a country then a popup would appear and show the country's name and corresponding value. I have successfully created the map and the boundaries of each country, however when you click…
user8944445
4
votes
1 answer

In shiny, how to fix (lock) leaflet map view zoom and center?

I am building a similar app to this one. On the map, if you zoom in and then change the slider/input, the zoom level resets to the default automatically. I would like to render new instances of the map without changing the zoom level until the user…
M_M
  • 899
  • 8
  • 21
4
votes
3 answers

calculate distance from all parts of polygon to closest points

I have two shapefiles: points and polygons. In the code below, I use gCentroid() from the rgeos package to calculate polygon centroids, and then I plot a buffer around the centroids. I want to create a raster layer from the polygon that represents…
Eric Green
  • 7,385
  • 11
  • 56
  • 102
4
votes
1 answer

Modifying Leaflet Popups in R

I want to modify the appearance of leaflet popups in R. The helpfile states that ... in the popupOptions() function takes "extra options passed to underlying Javascript object constructor." In this example, the style option is set to a list of CSS…
mzuba
  • 1,226
  • 1
  • 16
  • 33
4
votes
1 answer

Add Icons to Layer Control in Leaflet R

how to add icons to the layer control in package Leaflet R?. I made icons with the following code: rojos <- makeAwesomeIcon(icon='ion-waterdrop', library='ion', markerColor = 'red', iconColor = 'white') verdes <-…
Edgar Mora
  • 63
  • 1
  • 3
1 2
3
33 34