Using leaflet function within the shiny context, I have been able to create a great interactive map. I would like to set the zoom to somewhere between 7 and 7.5 (e.g., 7.25). I tried to do so as is shown in the code below but the zoom level in the map remained unchanged. It appears that one can set the zoom level to either 7 or 7.5 not anything between these numbers. How can fix this?
setView(-82.706838, 40.358615, zoom=7.25)
Use leaflet map options:
zoomSnap
: how small you can define the zoom level.zoomDelta
: how much the view zooms when clicking zoom control buttonsleaflet(options = leafletOptions(zoomSnap = 0.25, zoomDelta=0.25)) %>%
addTiles()%>%
setView(lng=-82.706838, lat=40.358615, zoom=7.25)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With