Skip to content

Commit

Permalink
Cleanup temp
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jun 6, 2017
1 parent da3420d commit 84a3c1e
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 145 deletions.
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Change Log

* Deprecated
* `GoogleEarthImageryProvider` has been deprecated and will be removed in Cesium 1.37, use `GoogleEarthEnterpriseMapsProvider` instead.
* The `throttleRequest` parameter for `TerrainProvider.requestTileGeometry`, `CesiumTerrainProvider.requestTileGeometry`, `VRTheWorldTerrainProvider.requestTileGeometry`, and `EllipsoidTerrainProvider.requestTileGeometry` is deprecated and will be replaced with an optional `Request` object. The `throttleRequests` parameter will be removed in 1.36, instead to throttle requests set the request's `throttle` property to `true`.
* The ability to provide a Promise for the `options.url` parameter of `loadWithXhr` is deprecated. The same applies for the `url` parameter for `loadArrayBuffer`, `loadBlob`, `loadImageViaBlob`, `loadText`, `loadJson`, `loadXML`, `loadImage`, `loadCRN`, `loadKTX`, and `loadCubeMap`. This will be removed in 1.36, instead `url` must be a string.
* The `throttleRequest` parameter for `TerrainProvider.requestTileGeometry`, `CesiumTerrainProvider.requestTileGeometry`, `VRTheWorldTerrainProvider.requestTileGeometry`, and `EllipsoidTerrainProvider.requestTileGeometry` is deprecated and will be replaced with an optional `Request` object. The `throttleRequests` parameter will be removed in 1.37, instead to throttle requests set the request's `throttle` property to `true`.
* The ability to provide a Promise for the `options.url` parameter of `loadWithXhr` is deprecated. The same applies for the `url` parameter for `loadArrayBuffer`, `loadBlob`, `loadImageViaBlob`, `loadText`, `loadJson`, `loadXML`, `loadImage`, `loadCRN`, `loadKTX`, and `loadCubeMap`. This will be removed in 1.37, instead `url` must be a string.

### 1.34 - 2017-06-01

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/CesiumTerrainProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ define([
}

if (typeof request === 'boolean') {
deprecationWarning('throttleRequests', 'The throttleRequest parameter for requestTileGeometry was deprecated in Cesium 1.35. It will be removed in 1.36.');
deprecationWarning('throttleRequests', 'The throttleRequest parameter for requestTileGeometry was deprecated in Cesium 1.35. It will be removed in 1.37.');
request = new Request({
throttle : request,
throttleByServer : request,
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/GoogleEarthEnterpriseTerrainProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ define([
sharedRequest = terrainRequests[q];
} else { // Create new request for terrain
if (typeof request === 'boolean') {
deprecationWarning('throttleRequests', 'The throttleRequest parameter for requestTileGeometry was deprecated in Cesium 1.35. It will be removed in 1.36.');
deprecationWarning('throttleRequests', 'The throttleRequest parameter for requestTileGeometry was deprecated in Cesium 1.35. It will be removed in 1.37.');
request = new Request({
throttle : request,
throttleByServer : request,
Expand Down
30 changes: 23 additions & 7 deletions Source/Core/Heap.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ define([
* @constructor
* @private
*
* @param {Function} comparator The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.
* @param {Object} options Object with the following properties:
* @param {Function} options.comparator The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.
*/
function Heap(comparator) {
function Heap(options) {
//>>includeStart('debug', pragmas.debug);
Check.defined('comparator', comparator);
Check.typeOf.object('options', options);
Check.defined('options.comparator', options.comparator);
//>>includeEnd('debug');

this._comparator = comparator;
this._comparator = options.comparator;
this._array = [];
this._length = 0;
this._maximumLength = undefined;
Expand Down Expand Up @@ -78,6 +80,19 @@ define([
this._array.length = value;
}
}
},

/**
* The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.
*
* @memberof Heap.prototype
*
* @type (Function}
*/
comparator : {
get : function() {
return this._comparator;
}
}
});

Expand Down Expand Up @@ -156,6 +171,7 @@ define([

var array = this._array;
var comparator = this._comparator;
var maximumLength = this._maximumLength;

var index = this._length++;
if (index < array.length) {
Expand All @@ -176,9 +192,9 @@ define([

var removedElement;

if (defined(this._maximumLength) && (this._length > this._maximumLength)) {
removedElement = array[this.maximumLength];
this._length = this._maximumLength;
if (defined(maximumLength) && (this._length > maximumLength)) {
removedElement = array[maximumLength];
this._length = maximumLength;
}

return removedElement;
Expand Down
24 changes: 5 additions & 19 deletions Source/Core/Request.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ define([
* @param {Boolean} [options.throttleByServer=false] Whether to throttle the request by server.
* @param {RequestType} [options.type=RequestType.OTHER] The type of request.
* @param {Number} [options.distance=0.0] The distance from the camera, used to prioritize requests.
* @param {Number} [options.screenSpaceError=0.0] The screen space error, used to prioritize requests.
*/
function Request(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
Expand All @@ -45,8 +44,6 @@ define([
* The actual function that makes the request. The function takes no arguments and returns a promise for the requested data.
*
* @type {Function}
*
* @private
*/
this.requestFunction = options.requestFunction;

Expand Down Expand Up @@ -94,41 +91,30 @@ define([
this.distance = defaultValue(options.distance, 0.0);

/**
* The screen space error, used to prioritize requests. This value may be edited continually to update
* the request's priority.
*
* @type {Number}
*
* @default 0.0
*/
this.screenSpaceError = defaultValue(options.screenSpaceError, 0.0);

/**
* The request server, derived from the url.
* The server key which contains the authority and scheme from the url.
*
* @type {String}
*
* @private
*/
this.server = undefined;
this.serverKey = undefined;

/**
* The current state of the request.
*
* @type {RequestState}
*
* @private
* @readonly
*/
this.state = RequestState.UNISSUED;

/**
* Reference to the underlying XMLHttpRequest so that it may be aborted in RequestScheduler.
* Function to call when a request is cancelled.
*
* @type {Object}
*
* @private
*/
this.xhr = undefined;
this.cancelFunction = undefined;

/**
* The requests's deferred promise.
Expand Down
Loading

0 comments on commit 84a3c1e

Please sign in to comment.