3DBAG / 3dbag-viewer

https://3dbag.nl
GNU General Public License v3.0
35 stars 10 forks source link

Cityjson files are opened in the browser instead of download #49

Closed balazsdukai closed 3 years ago

balazsdukai commented 3 years ago

When clicking on the download link of a tile, the cityjson file is opened in the browser instead of opening the download dialog of the browser.

Originally I had this working in the script, I'm not sure why it was changed from:

var filename = e.selected[0].get('tile_id')+'.json.gz';
window.location.href = 'http://godzilla.bk.tudelft.nl/v20100/'+filename;

to https://github.com/tudelft3d/3dbag-viewer/blob/a9cb3fa98de7f20f63c39c042bb9b1aaa5ba0fa5/public/main_tiles.js#L61-L70

Ylannl commented 3 years ago

Fixed with 4ee238e.

The difficulty here are cross-origin downloads (so from a different server as the webpage itself). This does not work due to security reasons (it is a feature of your browser). That is probably why I changed it originally. Therefore the download still doesn't work if you run the viewer locally.