1
我想在我的R Leaflet地圖中設置縮小最大值。我按照Prevent zooming out in leaflet R-Map?中的上一個問題/回答的示例進行操作,但它不起作用。該線應該能夠做到這一點是:R小冊子:縮放控制級別
options = providerTileOptions(minzoom = 1, maxzoom = 10))
你們可以幫我找出原因嗎?
這裏是代碼:
deck_lf_par_map <- leaflet(lpoints) %>%
addPolygons(data = dio, noClip=T,
weight = 4,
dashArray="5, 1",
color = "black",
fillOpacity = .01,
smoothFactor = 0) %>%
setView(lng = mean(lpoints$long), lat = mean(lpoints$lat), zoom = 09) %>%
addProviderTiles("Stamen.TonerLite",
group = "Toner",
options = providerTileOptions(minzoom = 1, maxzoom = 10)) %>%
addTiles(group = "OSM") %>%
addProviderTiles("Esri.WorldTopoMap",
group = "Topo") %>%
addProviderTiles("OpenStreetMap.Mapnik", group = "Mapnik") %>%
addProviderTiles("CartoDB.Positron", group = "CartoDB") %>%
setMaxBounds(([email protected][1,1] - .3),
([email protected][2,1] - .3),
([email protected][1,2] + .3),
([email protected][2,2] + .3)) %>%
addMarkers(lpoints$long,
lpoints$lat,
popup=ppopup,
icon = tec_icon,
group="Parishes",
clusterOptions = markerClusterOptions()) %>%
addLayersControl(baseGroups = c("Toner", "OSM", "Topo", "Mapnik", "CartoDB"),
options = layersControlOptions(collapsed = TRUE))
謝謝您的回答。 –