Skip to content

Commit 7eb80b0

Browse files
authored
Merge pull request #5892 from AnalyticalGraphicsInc/local-resources
Allow local-running Cesium to load its resources
2 parents c1b7f42 + e7532bf commit 7eb80b0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Change Log
22
==========
33
### 1.39 - 2017-11-01
44

5+
* Added the ability to load Cesium's assets from the local file system if security permissions allow it. [#5830](https://github.com/AnalyticalGraphicsInc/cesium/issues/5830)
56
* Added function that inserts missing namespace declarations into KML files. [#5860](https://github.com/AnalyticalGraphicsInc/cesium/pull/5860)
67
* Added support for the layer.json `parentUrl` property in `CesiumTerrainProvider` to allow for compositing of tilesets.
78
* Fixed a bug that caused KML ground overlays to appear distorted when rotation was applied. [#5914](https://github.com/AnalyticalGraphicsInc/cesium/issues/5914)

Source/Core/loadWithXhr.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,14 @@ define([
172172
xhr.responseType = responseType;
173173
}
174174

175+
// While non-standard, file protocol always returns a status of 0 on success
176+
var localFile = false;
177+
if (typeof url === 'string') {
178+
localFile = url.indexOf('file://') === 0;
179+
}
180+
175181
xhr.onload = function() {
176-
if (xhr.status < 200 || xhr.status >= 300) {
182+
if ((xhr.status < 200 || xhr.status >= 300) && !(localFile && xhr.status === 0)) {
177183
deferred.reject(new RequestErrorEvent(xhr.status, xhr.response, xhr.getAllResponseHeaders()));
178184
return;
179185
}

0 commit comments

Comments
 (0)