Locking the zoom in on Mapview?

534 views Asked by At

I am creating a map plotted with points around the UK map with map view library in R. I want to have a fixed zoom or zoom button disabled. I don't want a Street view/Zoom in due to GDPR issues. I wonder if there is a solution for this? Thanks.

library(sf)
library(mapview)

mapview(datamap, xcol = "Longitude", ycol = "Latitude")
1

There are 1 answers

0
TimSalabim On

This is not possible with mapview and kinda defeats the purpose of the package. If you want this type of behaviour you either need to create the complete map using leaflet or at least create the base map with leaflet and then use it with mapview:

library(mapview)
library(leaflet)

map = leaflet(options = leafletOptions(minZoom = 12, maxZoom = 12)) %>%
  addTiles()
mapview(franconia, map = map)