bdvis icon indicating copy to clipboard operation
bdvis copied to clipboard

Resources for bdwebmap example are blocked by browser.

Open hxxr opened this issue 5 years ago • 2 comments

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))

sessionInfo.txt

hxxr avatar Jan 05 '20 01:01 hxxr

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

ZeroDawn0D avatar Jan 07 '20 19:01 ZeroDawn0D

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.

Session_Info.txt

pratishrai avatar Jan 09 '20 01:01 pratishrai