Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Removed ability to pass a promise to the load functions
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Sep 1, 2017
1 parent ee6f7d1 commit a212b34
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 30 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change Log
* Breaking changes
* Passing `options.clock` when creating a new `Viewer` instance is removed, pass `options.clockViewModel` instead.
* Removed `GoogleEarthImageryProvider`, use `GoogleEarthEnterpriseMapsProvider` instead.
* Removed the ability to provide a Promise for the `options.url` parameter of `loadWithXhr` and for the `url` parameter of `loadArrayBuffer`, `loadBlob`, `loadImageViaBlob`, `loadText`, `loadJson`, `loadXML`, `loadImage`, `loadCRN`, `loadKTX`, and `loadCubeMap`. Instead `url` must be a string.
* Fixed `Entity` id type to be `String` in `EntityCollection` and `CompositeEntityCollection` [#5791](https://github.com/AnalyticalGraphicsInc/cesium/pull/579)
* Fixed `replaceState` bug that was causing the `CesiumViewer` demo application to crash in Safari and iOS
* Fixed issue where `Model` and `BillboardCollection` would throw an error if the globe is undefined [#5638](https://github.com/AnalyticalGraphicsInc/cesium/issues/5638)
Expand Down
15 changes: 0 additions & 15 deletions Source/Core/loadImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ define([
'./Check',
'./defaultValue',
'./defined',
'./deprecationWarning',
'./DeveloperError',
'./isCrossOriginUrl',
'./isDataUri',
Expand All @@ -15,7 +14,6 @@ define([
Check,
defaultValue,
defined,
deprecationWarning,
DeveloperError,
isCrossOriginUrl,
isDataUri,
Expand Down Expand Up @@ -61,19 +59,6 @@ define([

allowCrossOrigin = defaultValue(allowCrossOrigin, true);

if (typeof url !== 'string') {
// Returning a promise here is okay because it is unlikely that anyone using the deprecated functionality is also
// providing a Request object marked as throttled.
deprecationWarning('url promise', 'url as a Promise is deprecated and will be removed in 1.37');
return url.then(function(url) {
return makeRequest(url, allowCrossOrigin, request);
});
}

return makeRequest(url, allowCrossOrigin, request);
}

function makeRequest(url, allowCrossOrigin, request) {
request = defined(request) ? request : new Request();
request.url = url;
request.requestFunction = function() {
Expand Down
15 changes: 0 additions & 15 deletions Source/Core/loadWithXhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ define([
'./Check',
'./defaultValue',
'./defined',
'./deprecationWarning',
'./DeveloperError',
'./Request',
'./RequestErrorEvent',
Expand All @@ -15,7 +14,6 @@ define([
Check,
defaultValue,
defined,
deprecationWarning,
DeveloperError,
Request,
RequestErrorEvent,
Expand Down Expand Up @@ -70,19 +68,6 @@ define([

var url = options.url;

if (typeof url !== 'string') {
// Returning a promise here is okay because it is unlikely that anyone using the deprecated functionality is also
// providing a Request object marked as throttled.
deprecationWarning('url promise', 'options.url as a Promise is deprecated and will be removed in Cesium 1.37');
return url.then(function(url) {
return makeRequest(options, url);
});
}

return makeRequest(options);
}

function makeRequest(options, url) {
var responseType = options.responseType;
var method = defaultValue(options.method, 'GET');
var data = options.data;
Expand Down

0 comments on commit a212b34

Please sign in to comment.