bdvis
bdvis copied to clipboard
Resources for bdwebmap example are blocked by browser.
I cannot run the bdwebmap example using Google Chrome on Windows because the browser blocks the resources required for the webpage to load when using the file
protocol:
Access to XMLHttpRequest at 'file:///C:/Users/<USERNAME>/bs/bs.geojson' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
The page will also not load in Internet Explorer, but it works fine in Microsoft Edge. In Google Chrome the issue can be circumvented by loading Chrome with the --allow-file-access-from-files
flag, but this is not a good approach.
Code:
require(bdvis)
require(rinat)
inat <- get_inat_obs_project("reptileindia")
inat <- format_bdvis(inat,source='rinat')
bdwebmap(head(inat,25))
library(rinat)
library(bdvis)
dataset <- get_inat_obs_project("flora-of-japan")
dataset <- format_bdvis(dataset, source = 'rinat')
dataset <- dataset[1:30,]
bdwebmap(dataset)
Status Google Chrome: Grey Screen with colour coded legend Internet Explorer: Grey Screen with colour coded legend Microsoft Edge: Functioning Opera: Grey Screen with colour coded legend Firefox: Grey Screen with colour coded legend Session Info
require(bdvis)
require(rinat)
inat<-get_inat_obs_project("reptileindia")
inat <- format_bdvis(inat,source='rinat')
bdwebmap(head(inat,30))
I have tried several browsers but the map is loading only in Microsoft Edge.