Skip to content

Commit

Permalink
Merge pull request CesiumGS#2874 from AnalyticalGraphicsInc/fly-to-mi…
Browse files Browse the repository at this point in the history
…n-height

Add maximumHeight option to Viewer.flyTo.
  • Loading branch information
pjcozzi committed Jul 8, 2015
2 parents b470c40 + dedde32 commit 89bd293
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Scene/CameraFlightPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ define([
altitude = Math.min(getAltitude(frustum, verticalDistance, horizontalDistance) * 0.20, 1000000000.0);
}

if (defined(optionAltitude) || maxHeight < altitude) {
if ((defined(optionAltitude) && optionAltitude < altitude) || maxHeight < altitude) {
var power = 8.0;
var factor = 1000000.0;

Expand Down
2 changes: 2 additions & 0 deletions Source/Widgets/Viewer/Viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to
* @param {Entity|Entity[]|EntityCollection|DataSource|Promise} target The entity, array of entities, entity collection or data source to view. You can also pass a promise that resolves to one of the previously mentioned types.
* @param {Object} [options] Object with the following properties:
* @param {Number} [options.duration=3.0] The duration of the flight in seconds.
* @param {Number} [options.maximumHeight] The maximum height at the peak of the flight.
* @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target.
* @returns {Promise} A Promise that resolves to true if the flight was successful or false if the entity is not currently visualized in the scene or the flight was cancelled.
*/
Expand Down Expand Up @@ -1590,6 +1591,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to
var userOptions = defaultValue(viewer._zoomOptions, {});
var options = {
duration : userOptions.duration,
maximumHeight : userOptions.maximumHeight,
complete : function() {
zoomPromise.resolve(true);
},
Expand Down

0 comments on commit 89bd293

Please sign in to comment.