If I implement a gpx track from a file of my harddisk to an OpenLayer it works great as long as the gpx file is in the same directory or in a directory down. I receive the map from the internet and the track from the harddisk can be seen. var GPXVariable_1 = new OpenLayers.Layer.Vector("Alpspitze", {
... url:"directory_x/Alpspitze.gpx" // works If I try to implement a gpx file that is in a different directory structure, it doesn't work. ... url:"../../directory_y/directory_z/Alpspitze.gpx" // doesn't work What am I doing wrong? What is the correct syntax for the address?
This question is marked "community wiki".
asked 07 Aug '14, 17:56 flegar |
In the meantime, I've got an answer from a different forum. Unfortunatelly there ist a restriction that allows local documents having access to other local documents in the same directory and in subdirectories, but not directory listings. When I change the config:about (Firefox) security.fileuri.origin_policy to false, the track gets visible although it is implemented from a different file tree. Conclusion: Due to the security police of browsers I have to rearrange my directory. answered 08 Aug '14, 12:46 flegar |
Maybe it is a security mechanism of the browser to prevent JavaScript code to read your whole file system and independent on OpenLayers. answered 08 Aug '14, 12:29 MarkusHD |