Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change line width of leaflet's stroke in leaflet

Tags:

r

leaflet

Is it possible, to make the black line thinner? Here's a reproducible example, see also here:

library(leaflet)
leaflet() %>%
  addTiles() %>%
  addProviderTiles(providers$OpenStreetMap, group = "OSM") %>%
  addProviderTiles(providers$Stamen.TonerLite, group = "Toner Lite") %>%
  addLayersControl(baseGroups = c("OSM", "Toner Lite")) %>% 
  leaflet::addCircleMarkers(lat = 0,
                            lng = 0,
                            color = "black",
                            fillColor = "red",
                            stroke = TRUE,
                            popup = "hello",
                            radius = 10,
                            fillOpacity = 0.7)
like image 366
Christoph Avatar asked Mar 11 '19 09:03

Christoph


1 Answers

You can specifiy the stroke weight with the weight argument:

library(leaflet)

leaflet() %>%
  addTiles() %>%
  addProviderTiles(providers$OpenStreetMap, group = "OSM") %>%
  addCircleMarkers(lat = 0,
                   lng = 0,
                   stroke = TRUE,
                   weight = 1)

enter image description here

leaflet() %>%
  addTiles() %>%
  addProviderTiles(providers$OpenStreetMap, group = "OSM") %>%
  addCircleMarkers(lat = 0,
                   lng = 0,
                   stroke = TRUE,
                   weight = 100)

enter image description here

like image 148
symbolrush Avatar answered Sep 30 '22 14:09

symbolrush