Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [leaflet-r]

Questions referring to the Leaflet R package.

0
votes
0answers
19 views

Specifying EPSG:31370 CRS in R Leaflet for WMS-service returns blank tiles

I am trying to load historical map tiles from a WMS-server (GetCapabilities) and display them using R Leaflet. Using the default CRS in Leaflet works fine, using e.g.: leaflet() %>% setView(4....
0
votes
0answers
32 views

Selecting and deselecting markers in leaflet under R shiny?

I would like to write a script that selects a marker on the map whenever I click on it and then deselect it when I click/select another marker (that is, so that no more that one marker is selected on ...
0
votes
1answer
37 views

Rearrange plotorder of SpatialPolygonsDataframe

I have a SpatialPolygonDataframe (loaded with readOGR) I want to plot in either tmap or leaflet. A lot of the polygons are overlapping, and the smaller polygons are completely covered by larger ...
0
votes
1answer
73 views

Conditionally adding markers to map in R leaflet and shiny

I am trying to add some markers to a leaflet map in R based on conditions that I select from an selectInput command. The selectInput command lets the user choose three different numbers (1, 2 or 4). ...
2
votes
1answer
45 views

How to create independent/fixed inset maps with leaflet?

I am trying to create a leaflet map of the USA focusing on the contiguous 48 states and then add two inset maps of Alaska and Hawaii on the side. The problem is that addMiniMap() option creates an ...
1
vote
1answer
50 views

R leaflet set zoom level of tiled basemap (ESRI World Imagery)

I need to define the maximum zoom level of a tiled map in R leaflet. The problem is that I have points that are placed very close to each other and I would like to be able to distinguish each of them ...
0
votes
0answers
44 views

Legend not shown in r-leaflet.minicharts and zoom buttons not working anymore

This script used to display a legend for the pie charts on the map. I cannot find the reason why the legend is not shown anymore. I suppose it is related to some problem with the leaflet plugin ...
0
votes
0answers
313 views

Adding polylines to leaflet map in R

I am trying to add great circle routes between various regions in R. Here's the sample data: structure(list(CommencingRegion = c("RedSea", "EastAfrica", "GulfofMexico", "FarEast", "RedSea", "...
1
vote
0answers
198 views

Adding color to polylines in leaflet in R

I have had a look at this and other links therein. This is exactly what I am trying to achieve and failing. Here is some sample data: structure( list( lat = c(51.88783,51.8878441,51.887825,51....
0
votes
0answers
76 views

Creating a function for my addCircleMarkers preferences?

I am currently working on making a leaflet map in R with multiple addCircleMarker layers. The following code works, where df1 and df2 are datasets with lat and long data: library(leaflet) library(...
1
vote
1answer
929 views

Displaying several data rows in popup using Leaflet for R?

While trying to map some quantitative data with leafletin R, I manage to place pie-charts with leaflet.minichartson the map, like in the following example: ### data ### d <- structure(list( ...
2
votes
1answer
535 views

R leaflet - Bring base layer labels to front

I want to use a base layer so that my filled polygons are in geographic context. However, my polygons have simply gone over the top of the base layer and therefore only bits and pieces of place names ...
0
votes
1answer
175 views

Highlight Borders When Mouseover Fill Area - Leaflet-R

Following the guidance of TimSalabim I separated the borders and fill of my neighbourhood polygons so that I could order them appropriately with zIndex. https://lawsblog.netlify.com/post/leaflet-map/ ...
0
votes
1answer
533 views

Order of Vector Layers in Leaflet-R

Here is a leaflet map in R https://lawsblog.netlify.com/post/leaflet-map/ The white lines are neighbourhood boundaries. The green polygons are parks. The parks are drawn over the boundaries ...
0
votes
0answers
108 views

Mouseover in Leaflet Map Permanently Changes Map Colour

Note that if you mouseover a neighbourhood in this leaflet map the green parks change shade. However, when you move the mouse away the parks remain this faded color. Why? Here is the map: https://...
1
vote
1answer
2k views

Add Layers with Leaflet from Different Spatial Data Frames in R

Very new to R's Leaflet package and have two spatial data frames. 1) An outline of a city 2) Its major highways I wish to show both of these on the same map. I get how to do this with ggmap or ...
1
vote
0answers
119 views

Use two shapefiles in one Leaflet map in R

My query along with a minimal working example is already posted here: https://stackoverflow.com/questions/48924514/using-data-from-2-shapefiles-with-leaflet-in-r?noredirect=1#comment84855712_48924514 ...
0
votes
0answers
66 views

distm() is giving wrong distance when computed vertically between points on leaftet map?

I am trying to get distance between points on the map. when I am computing distance horizontally, it gives me fair estimate. However, digitizing vertically and getting distance between them, gives me ...
1
vote
0answers
355 views

R Shiny / leaflet map: Projection problem in creating map in Plate Carree projection

I'm trying to create an R Shiny map using the leaflet package to display input layers in the Plate Carree projection rather than the default Spherical Mercator projection. I've input OSM and WMS tile ...
3
votes
1answer
772 views

Displaying sum of frequencies in leaflet cluster maps pointer

I've a dataset with locations and their frequencies (sum of counts) I want the leaflet cluster to display the frequencies as pointers instead of the count of occurrences. city state ...
2
votes
1answer
526 views

LeafletCRS projection issues

I am trying to get a map in the Dutch Rijksdriehoekstelsel coordinates in a Leaflet map in R that is going in a Shiny app later. I am going to have to add polygons later, and changing their X and Y ...
1
vote
1answer
261 views

Using leaflet with large data - ACS data for all counties in U.S

I'm plotting ACS data (counts of low-income children) for each county across the entire U.S. I don't have any markers, just a county shapefile and a value for each county in a popup. Unsurprisingly ...
4
votes
1answer
4k views

Generating random lat/long coordinates

Dedicated page on use of leaflet in R provides a very useful example on generating random latitude and longitude values for Central Europe: cbind(rnorm(40) * 2 + 13, rnorm(40) + 48) which results in ...
0
votes
1answer
2k views

Cutting leaflet map in R to a specific area

I am trying to cut a leaflet map in R, so I only show a specific municipality. I have manage to hide the remaining municipalities in the country, but that leaves the water and the rest of the world ...
4
votes
1answer
818 views

Why does Leaflet with provider tiles not draw markers as expected?

I'm working with Leaflet maps in Shiny for R. I'm producing a map with some markers on it. When I use addTiles () for my base map, everything works as expected. However with addProviderTiles (), the ...
1
vote
0answers
239 views

Proj4leaflet in UTM 32

I am trying to create a simple map in UTM32 (EPSG:25832) in R with leaflet and proj4leaflet, but I can't get it to work. I found a url for the basemap, but it could be a different one if you like - I ...
0
votes
0answers
1k views

Leaflet: addPolylines is not plotting all values (or lines) of a spatialLinesDataFrame object

I'm using addPolylines to overlay contours of a specific value(s) on a leaflet generated web map, however, addPolylines is not plotting all the data that it is supplied with. As per the first image, ...