Skip to content

Commit

Permalink
Fix code to be ES5 compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
ComBatVision committed Sep 27, 2022
1 parent 20c5526 commit 163aa21
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/WorldWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,17 @@ define([
* @returns {LookAt} A reference to the result parameter.
* @throws {ArgumentError} If the specified result object is null or undefined.
*/
WorldWindow.prototype.cameraAsLookAt = function (result, terrainPosition = this.pick([this.viewport.width / 2, this.viewport.height / 2]).terrainObject().position) {
WorldWindow.prototype.cameraAsLookAt = function (result, terrainPosition) {
if (!result) {
throw new ArgumentError(
Logger.logMessage(Logger.LEVEL_SEVERE, "Camera", "getAsLookAt", "missingResult"));
}
if (!terrainPosition) {
var terrainObject = this.pick([this.viewport.width / 2, this.viewport.height / 2]).terrainObject();
if (terrainObject) {
terrainPosition = terrainObject.position;
}
}

var globe = this.globe,
forwardRay = this.scratchRay,
Expand Down

0 comments on commit 163aa21

Please sign in to comment.