knitr::opts_chunk$set(echo = TRUE) library(rgee) library(shiny) library(leaflet) ee_Initialize()
library(leaflet.minicharts) library(manipulateWidget) library(leafsync) map_sync <- function(m1, m2, type = c("widget", "leafsync"), ...) { FUN = switch(type, "widget" = manipulateWidget::combineWidgets, "leafsync" = leafsync::sync ) if (type == "widget") { m1 = m1 %>% syncWith("one") m2 = m2 %>% syncWith("one") } m <- FUN(m1, m2, ...) m } m1 <- Map$addLayer(eeObject = ee$Image("CGIAR/SRTM90_V4")) m2 <- Map$addLayer( eeObject = ee$Image("CGIAR/SRTM90_V4"), visParams = list(min=0,max=3000) )
map_sync(m1, m2, "widget", nrow = 1, width = 950, height = 400)
map_sync(m1, m2, "leafsync")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.