leaflet icon indicating copy to clipboard operation
leaflet copied to clipboard

addCircleMarkers radius smaller than 1

Open jay-sf opened this issue 3 years ago • 0 comments

Hi, thanks for maintaining the leaflet R package!

I wonder how I might get a better control of the circle radius. Depending on the zoom factor it can get pretty clumpy. How is it possible to get smaller circles, say 1/2 or 1/4 the size? I tried values smaller than 1, but decimal resolution doesn't seem to be possible. Please see the small example below.

Rplot27

co <- c(-74.04456199608506, 40.68923184725649) + replicate(20, rnorm(2, 1e-4, 1e-4))
m <- leaflet() %>% 
  addTiles("https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png") %>%
  setView(-74.045, 40.689, zoom=14)
m$x$options <- append(m$x$options, list("zoomControl"=FALSE))
m %>%
  addCircleMarkers(co[1, ], co[2, ], radius=1, color='white')

jay-sf avatar Sep 22 '22 11:09 jay-sf