-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file:/// protocol when using Cesium off the web #3935
Comments
What does the code you are using to load the imagery look like? I suspect this is a problem at the app level. |
I just select Natural Earth II from the imagery picker. No code for that. |
Are you setting |
No, I'm not. Where should I be setting this? |
I'm not sure that's the problem; I'm just trying to figure out what the issue could be. |
I just tried |
If you wanted to try setting it, I would use the absolute path with the 3 slashes. |
I tried: |
@TomPed is this still a problem or did you find a solution? |
Yes, this is still a problem, I have that hacky fix that I mentioned, but that's it. |
Okay thanks, just checking =) |
I think the problem here that By hacking in an extra Instead, I suggest that you use a relative URL, without specifying the protocol (i.e. without I don't think this is a bug in Cesium. |
Cesium depends too heavily on XHR. It will never work from the |
@emackey Just to clarify, XHR and Cesium works great with the file protocol, obviously it won't work when running in the browser Sandbox, but for offline web-based containers, like Electron, the whole point is to read off of the file system. I think @twpayne is correct here and it was simply an error in the electron app itself. |
@twpayne can you open a PR to fix the demo app? https://github.com/TomPed/Electron-Cesium-Starter-Kit |
Using three slashes Tested in cesium 1.87 |
This issue has to do with Cesium being used off the web, i.e., Electron and Cordova trying to load the Natural Earth II imagery.
When you try loading the offline imagery you get this error:
net::ERR_FILE_NOT_FOUND
. One of the files not found are:file://users/tpedbereznak/Cesium-Editor/node_modules/cesium/Build/CesiumUnminified/Assets/Textures/NaturalEarthII/tilemapresource.xml
. If you changefile://
tofile:///
then the file is found. Knowing this I made a hacky fix.In
loadXML.js
I change line line 37:url : url,
tourl : url.slice(0, 7) + "/" + url.slice(7),
.In
UrlTemplateImageryProvider.prototype.reinitialize
I changed line line 504:that._url = properties.url;
tothat._url = properties.url.slice(0, 7) + "/" + properties.url.slice(7);
Now url's with
file://
with be changed tofile:///
and load the Natural Imagery II. How can this be fixed without this hacky solution?The text was updated successfully, but these errors were encountered: