简体   繁体   中英

GitHub Pages: 404 Error loading .csv file

I'm trying to deploy a map online into GitHub pages, however I'm getting the error ( see webmap ) which I'm not getting working locally:

GET https://cccruzr.github.io/maps/data/data.csv 404 (Not Found)

It is the first time that it happens to me since I've already uploaded other maps and webpages.

The line where I'm calling the file is the following (you can check the whole project -and file structure- on my repository ):

var myLayer = omnivore.csv('../_data/data_lideres.csv', null, lideresLayer);

Any idea on how to solve this issue?

NOTE: I was getting the same error with CSS files starting with underscore and had to rename all of them... it makes me think that it might be something related with Jekyll too...

It seems the url is missing the LideresSociales folder no? Maybe you're going back 1 folder more than needed in your code.

https://github.com/cccruzr/maps/blob/master/LideresSociales/data/data_lideres.csv

Try just omnivore.csv('./data/data_lideres.csv', null, null);

As pointed by @ghybs reference source :

When an external JavaScript file is loaded into a Web page, its frame of reference for document-relative paths is the location of the Web page itself. So, any document relative paths you include in the JavaScript file must be relative to the Web page and not the JavaScript file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM