Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cartographicLimitRectangle default and doc #7479

Merged
merged 1 commit into from
Jan 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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