You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was experimenting with the print method and I tried to grey out the part about if (ide == "vscode") and in this case it works also with mapviewOptions(fgb = TRUE), but not with mapviewOptions(viewer.suppress = TRUE).
printMapview=function (x) {
## normal htmlwidget printing for notebooks etc.## set options fgb & georaster to FALSE!!if (!isTRUE(mapviewGetOption("fgb")) &!isTRUE(mapviewGetOption("georaster"))) {
print(mapview2leaflet(x))
# invisible(x)return(invisible())
}
## convert to leaflet objectx= mapview2leaflet(x)
viewer= getOption("viewer")
ide= get_ide()
if (mapviewGetOption("viewer.suppress")) {
viewer=NULL
}
if (!is.null(viewer)) {
viewerFunc=function(url) {
paneHeight=x$sizingPolicy$viewer$paneHeightif (identical(paneHeight, "maximize")) {
paneHeight=-1
}
# I REMOVED THIS PART >>>>># if (ide == "vscode") {# # VSCode's viewer can't ignore cross-origin requests. Need to serve the# # map so assests can be read, e.g. .fgb files.# server <- servr::httd(# dir = get_url_dir(url),# verbose = FALSE,# browser = FALSE# )# url <- server$url# }# <<<<<<<<<<<<<<<<<<<<<<<<
viewer(url, height=paneHeight)
}
} else {
viewerFunc=function(url) {
dir= get_url_dir(url)
switch(ide,
"rstudio"=if (mapviewGetOption("viewer.suppress")) {
fl= file.path(dir, "index.html")
utils::browseURL(fl)
} else {
servr::httd(
dir=dir,
verbose=FALSE
)
},
"vscode"=servr::httd(
dir=dir,
verbose=FALSE
),
# defaultservr::httd(
dir=dir,
verbose=FALSE
)
)
}
}
htmltools::html_print(
htmltools::as.tags(x, standalone=TRUE)
, viewer=if (interactive()) viewerFunc
)
invisible(x)
}
Hello!
I am in VSCode 1.89.1. This script opens a Viewer on the side but it is empty.
The same address opened in Firefox or Chrome still shows an empty page. If I inspect the html code, it is indeed empty.
With
fgb = FALSE
it works as expected in the VSCode viewer.I was experimenting with the
print
method and I tried to grey out the part aboutif (ide == "vscode")
and in this case it works also withmapviewOptions(fgb = TRUE)
, but not withmapviewOptions(viewer.suppress = TRUE)
.My session info:
The text was updated successfully, but these errors were encountered: