Skip to content
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

Fix using Cesium inside of Electron apps. #6726

Merged
merged 2 commits into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Change Log
* The `PostProcessStageLibrary.createBlackAndWhiteStage` and `PostProcessStageLibrary.createSilhouetteStage` have per-feature support.

##### Fixes :wrench:
* Fixed a bug that caused Cesium to be unable to load local resources in Electron. [#6726](https://github.com/AnalyticalGraphicsInc/cesium/pull/6726)
* Fixed a bug causing crashes with custom vertex attributes on `Geometry` crossing the IDL. Attributes will be barycentrically interpolated. [#6644](https://github.com/AnalyticalGraphicsInc/cesium/pull/6644)
* Fixed a bug causing Point Cloud tiles with unsigned int batch-ids to not load. [#6666](https://github.com/AnalyticalGraphicsInc/cesium/pull/6666)
* Fixed a bug with Draco encoded i3dm tiles, and loading two Draco models with the same url. [#6668](https://github.com/AnalyticalGraphicsInc/cesium/issues/6668)
Expand Down
9 changes: 0 additions & 9 deletions Source/Core/FeatureDetection.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,6 @@ define([
return isFirefox() && firefoxVersionResult;
}

var isNodeJsResult;
function isNodeJs() {
if (!defined(isNodeJsResult)) {
isNodeJsResult = typeof process === 'object' && Object.prototype.toString.call(process) === '[object process]'; // eslint-disable-line
}
return isNodeJsResult;
}

var hasPointerEvents;
function supportsPointerEvents() {
if (!defined(hasPointerEvents)) {
Expand Down Expand Up @@ -238,7 +230,6 @@ define([
isFirefox : isFirefox,
firefoxVersion : firefoxVersion,
isWindows : isWindows,
isNodeJs: isNodeJs,
hardwareConcurrency : defaultValue(theNavigator.hardwareConcurrency, 3),
supportsPointerEvents : supportsPointerEvents,
supportsImageRenderingPixelated: supportsImageRenderingPixelated,
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -1834,14 +1834,15 @@ define([
}).end();
}

var noXMLHttpRequest = typeof XMLHttpRequest === 'undefined';
Resource._Implementations.loadWithXhr = function(url, responseType, method, data, headers, deferred, overrideMimeType) {
var dataUriRegexResult = dataUriRegex.exec(url);
if (dataUriRegexResult !== null) {
deferred.resolve(decodeDataUri(dataUriRegexResult, responseType));
return;
}

if (FeatureDetection.isNodeJs()) {
if (noXMLHttpRequest) {
loadWithHttpRequest(url, responseType, method, data, headers, deferred, overrideMimeType);
return;
}
Expand Down
4 changes: 0 additions & 4 deletions Specs/Core/FeatureDetectionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,4 @@ defineSuite([
expect(FeatureDetection.imageRenderingValue()).not.toBeDefined();
}
});

it('detects Node.js', function() {
expect(FeatureDetection.isNodeJs()).toBe(false);
});
});