Skip to content

Commit

Permalink
sepia components in view mode (todo compass, background) #861
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed Apr 10, 2024
1 parent 705300d commit 5adcc5a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion R/tmapLeafletRun.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ tmapLeafletRun = function(o, show, knit, args) {
lfs = get("lfs", envir = .TMAP_LEAFLET)

lfs2 = lapply(lfs, function(lfsi) {
if (o$nrows == 1 && o$ncols == 1) {
x = if (o$nrows == 1 && o$ncols == 1) {
lfsi[[1]]
} else {
fc = o$free.coords
Expand All @@ -20,6 +20,16 @@ tmapLeafletRun = function(o, show, knit, args) {
#print(do.call(leafsync::latticeView, c(lfsi, list(ncol = o$ncols, sync = sync, sync.cursor = all(!fc), no.initial.sync = FALSE, between = list(x = marg, y = marg)))))
do.call(leafsync::latticeView, c(lfsi, list(ncol = o$ncols, sync = sync, sync.cursor = all(!fc), no.initial.sync = FALSE)))
}
if (o$pc$sepia.intensity != 0) {
col = process_color("#ffffff", sepia.intensity = o$pc$sepia.intensity)
htmlwidgets::prependContent(x, htmltools::tags$style(paste0(
".leaflet-control-layers {background: ", col, ";}
.leaflet-control-zoom-in {background: ", col, " !important;}
.leaflet-control-zoom-out {background: ", col, " !important;}"
)))
} else {
x
}
})

if (length(lfs2) == 1) lfs2 = lfs2[[1]]
Expand Down

0 comments on commit 5adcc5a

Please sign in to comment.