Skip to content

Commit

Permalink
Merge pull request #7479 from AnalyticalGraphicsInc/cartographicLimit…
Browse files Browse the repository at this point in the history
…RectangleFixes

Fix cartographicLimitRectangle default and doc
  • Loading branch information
lilleyse authored Jan 11, 2019
2 parents 15d5cde + e567cf0 commit 9b161e2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
if (checked) {
viewer.scene.globe.cartographicLimitRectangle = coffeeBeltRectangle;
} else {
viewer.scene.globe.cartographicLimitRectangle = Cesium.Rectangle.MAX_VALUE;
viewer.scene.globe.cartographicLimitRectangle = undefined;
}
});

Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Change Log
* Fix rectangle positions at the north and south poles. [#7451](https://github.com/AnalyticalGraphicsInc/cesium/pull/7451)
* Fixed image size issue when using multiple particle systems. [#7412](https://github.com/AnalyticalGraphicsInc/cesium/pull/7412)
* Fixed Sandcastle's "Open in New Window" button not displaying imagery due to blob URI limitations. [#7250](https://github.com/AnalyticalGraphicsInc/cesium/pull/7250)
* Fixed an issue where setting `scene.globe.cartographicLimitRectangle` to `undefined` would cause a crash. [#7477](https://github.com/AnalyticalGraphicsInc/cesium/issues/7477)

### 1.53 - 2019-01-02

Expand Down
11 changes: 11 additions & 0 deletions Source/Scene/Globe.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,22 @@ define([
this._surface.tileProvider.clippingPlanes = value;
}
},
/**
* A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area.
* Defaults to the maximum extent of cartographic coordinates.
*
* @member Globe.prototype
* @type {Rectangle}
* @default Rectangle.MAX_VALUE
*/
cartographicLimitRectangle : {
get : function() {
return this._surface.tileProvider.cartographicLimitRectangle;
},
set : function(value) {
if (!defined(value)) {
value = Rectangle.clone(Rectangle.MAX_VALUE);
}
this._surface.tileProvider.cartographicLimitRectangle = value;
}
},
Expand Down
5 changes: 5 additions & 0 deletions Specs/Scene/GlobeSurfaceTileProviderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,11 @@ defineSuite([
});
});

it('cartographicLimitRectangle defaults to Rectangle.MAX_VALUE', function() {
scene.globe.cartographicLimitRectangle = undefined;
expect(scene.globe.cartographicLimitRectangle.equals(Rectangle.MAX_VALUE)).toBe(true);
});

it('cartographicLimitRectangle culls tiles outside the region', function() {
switchViewMode(SceneMode.COLUMBUS_VIEW, new GeographicProjection(Ellipsoid.WGS84));
var unculledCommandCount;
Expand Down

0 comments on commit 9b161e2

Please sign in to comment.