Open ghost opened 3 years ago
When the leaflet is run by shiny/rmarkdown, it is hosted by a server and not your file system.
I'm wondering if trying to load a (most likely) https://
based tiles when the local file is hosted by a file://
, the browser is not allowing it due to security concerns.
I am curious if you use a small plumber router to host your leaflet folder, if it it will work.
Ex:
library(plumber)
pr() %>%
pr_static("/", ".") %>% # "." is the location of the folder containing your `index.html`
pr_run(port = 8000)
Visit 127.0.0.1:8000/index.html
and I hope the leaflet map will display as expected.
I am curious if you use a small plumber router to host your leaflet folder, if it it will work.
Ex:
library(plumber) pr() %>% pr_static("/", ".") %>% # "." is the location of the folder containing your `index.html` pr_run(port = 8000)
Visit
127.0.0.1:8000/index.html
and I hope the leaflet map will display as expected.
In my current directory
containing the index.html
, when I use your code I get an error:
Was I suppose to use this code within my R-markdown file when building the index.html
? I am confused as to where this code fits in the overall procedure.
Can you try a different port? Looks like 8000
is busy already. Can remove the port
argument and it'll find an available port.
This is suppose to be in a regular R session, like you have done.
No success yet:
When visiting 127.0.0.1:7647/index.html
I get no map display:
Last check... Are there any errors in your browser while visiting the website?
Chrome: View > Developer > JavaScript Console
Thank you
What does this <div id="MathJax_Message" style="display: none;"></div>
mean? Also I am using Firefox browser. But I tried with Chrome (same) issue:
First Attempt with SublimeText 3 R Markdown Build
If I build with
R Markdown
in SublimeText 3, anindex.html
file is generated. If I then open this.html
file in either Firefox, Chrome, Brave, etc, the map does not render. For example:Result
Second Attempt with Terminal
However, If I switch to my Windows terminal and load
R
, then usermarkdown::run()
, the map generates in either browser of choice. For instance:Result
Reprex Code:
flexdashboard
withshiny
integrationColumn {.sidebar}
Epicenter Region
Column
COVID-19 Epicenters