Skip to main content

All Questions

Tagged with
1 vote
1 answer
25 views

How to assign a leaflet layer to a group, when that layer is created by an extension of leaflet?

This R code creates a leaflet map with two base layers. The user can toggle between the two layers. leaflet() |> addTiles(group = "group 1") |> addProviderTiles(provider = ...
John J.'s user avatar
  • 1,676
1 vote
1 answer
23 views

How to add markers in a Leaflet minimap?

I have created an application in Shiny which allows for selecting a place and then displays a datatable with information and a marker at the corresponding position in the map. The marker is set in ...
Raq's user avatar
  • 97
0 votes
0 answers
37 views

Ho to make markers have different colors based on specific variable in R using leaflet?

What I want: I want to make markers appear with different colors my map will have radio button to control (show/hide) markers by variable 'color_status' match color scale to the color of the markers -...
zakmn moh's user avatar
0 votes
1 answer
77 views

How to Dynamically Add Markers to a Leaflet Map in Shiny App Using JavaScript?

I'm working on a Shiny application that includes a Leaflet map. I want to dynamically add markers to the map based on user input, but I'm encountering issues when trying to add these markers using ...
Jarn Schöber's user avatar
10 votes
1 answer
544 views

Load Quarto html map data from json for Leaflet map generated in R

I have created a Quarto blog post which contains many leaflet maps, generated in R. As the data for each map is embedded within the html file, the file itself is very large. This is causing problems ...
SamR's user avatar
  • 16.7k
0 votes
0 answers
189 views

Toggle Legends in leaflet map generated in R based on base layer selected

I have created a polygonal choropleth map in leaflet that toggles different geometries and legends on the regional and county (parish) level. The code works, but I made the addLayersControl toggle on ...
Gabriel Necula's user avatar
0 votes
1 answer
313 views

How to make leaflet markers fit within sf polygons for any zoom level?

How can I dynamically size leaflet markers to fit within sf polygons for any zoom level? I have a series of sf polygons similiar to the nc (North Carolina) example below. Each of these polygons has ...
lget's user avatar
  • 26
1 vote
1 answer
651 views

Save click coordinates

I have a Shiny app where the goal is to send the user's location to a database. The app automatically detects the user's location, and assigns that to input$lat and input$long. The app also has a ...
Ralph Asher's user avatar
1 vote
1 answer
368 views

How to query a Web Map Service layer with a fake click?

I'm trying to display the information tooltip of a queryable WMS (Web Map Service) layer in a leaflet in Shiny. I need it to be performed in 2 different ways: 1/ clicking 2/ typing in coordinates. ...
Dric's user avatar
  • 107
1 vote
1 answer
251 views

How to prevent BringToBack from reversing layers order of FeatureGroup in Leaflet

I have a Leaflet Map on a Shiny web-app. I have 3 Base Groups containing different circles, and 1 Overlay Group containing polylines crossing each other. The polylines are sorted so that the more ...
Mattéo Camin's user avatar
3 votes
1 answer
1k views

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). --- ...
Chris's user avatar
  • 1,503
2 votes
1 answer
1k views

Programatically trigger marker mouse click event in R leaflet for shiny

My question is identical to this one: Trigger marker mouse click event in R leaflet for shiny but I don't have enough rep to add a comment, and the edit queue is 'full' so I can't add my thoughts to ...
Graeme Diack's user avatar
6 votes
1 answer
321 views

R & Leaflet: how to bind a client-side event to a polygon

Here is a simple shiny app: library(shiny) library(leaflet) nc = sf::st_read(system.file("shape/nc.shp", package="sf")) ui <- function(request){ tagList( selectInput(&...
Colin FAY's user avatar
  • 5,069
7 votes
2 answers
1k views

Pie charts in R leaflet, turn count into sum and control more the size

I am fascinated by the solution of grouping markers and presenting counts by groups in form of small piecharts https://stackoverflow.com/a/60525137/3480717 I am R only and do not know JS. I would like ...
Jacek Kotowski's user avatar
0 votes
3 answers
1k views

leaflet-groupedlayercontrol using group layers in R

I am interested in using leaflet-groupedlayercontrol within an Leaflet map created in R and have been following this gist. I can successfully add the JS plugin (as in this working example below), but ...
SEAnalyst's user avatar
  • 1,112

15 30 50 per page