-
Notifications
You must be signed in to change notification settings - Fork 506
Open
Description
I need to open the map with a relatively wide extent, but then some groups would
need a more zoomed view. Is there a way to define specific setView() for different groups?
For example, in this example:
library(RStoolbox) #for the example satellite image
library(terra)
library(leaflet)
B4 <- project(rast(system.file("external/landsat/LT52240631988227CUB02_B4.TIF", package="RStoolbox")), "EPSG:4326")
ext(B4)
leaflet() %>%
setView(lng = -50.5, lat=-3.4 , zoom = 9) %>%
addTiles() %>%
addProviderTiles(providers$Esri.WorldImagery, group = c("Satview", "Landsat")) %>%
addRasterImage(B4, group = "Landsat") %>%
addLayersControl(
#baseGroups = c("Satview","OSM","r1","a"),
baseGroups = c("Satview","Landsat"),
options = layersControlOptions(collapsed = FALSE, autoZIndex = TRUE))
I would need a "zoom to layer" behaviour when selecting the group Landsat.
Metadata
Metadata
Assignees
Labels
No labels