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

Adds ability to set bottomContainer will not be created by default. #9742

Closed
wants to merge 4 commits into from
Closed
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
##### Additions :tada:

- `BingMapsGeocoderService` now takes an optional [Culture Code](https://docs.microsoft.com/en-us/bingmaps/rest-services/common-parameters-and-types/supported-culture-codes) for localizing results.
- Adds ability to set bottomContainer will not be created by default. [#9742](https://github.com/CesiumGS/cesium/pull/9742)

##### Fixes :wrench:

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
- [Ethan Wong](https://github.com/GetToSet)
- [Calogero Mauceri](https://github.com/kalosma)
- [Ren Jianqiang](https://github.com/renjianqiang)
- [Yang Puxiao](https://github.com/puxiao)
19 changes: 12 additions & 7 deletions Source/Widgets/Viewer/Viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ function enableVRUI(viewer, enabled) {
* @property {MapProjection} [mapProjection=new GeographicProjection()] The map projection to use in 2D and Columbus View modes.
* @property {Globe|false} [globe=new Globe(mapProjection.ellipsoid)] The globe to use in the scene. If set to <code>false</code>, no globe will be added.
* @property {Boolean} [orderIndependentTranslucency=true] If true and the configuration supports it, use order independent translucency.
* @property {Boolean} [bottomContainer] If set to false, the {@link Viewer#bottomContainer} will not be created.
* @property {Element|String} [creditContainer] The DOM element or ID that will contain the {@link CreditDisplay}. If not specified, the credits are added to the bottom of the widget itself.
* @property {Element|String} [creditViewport] The DOM element or ID that will contain the credit pop up created by the {@link CreditDisplay}. If not specified, it will appear over the widget itself.
* @property {DataSourceCollection} [dataSources=new DataSourceCollection()] The collection of data sources visualized by the widget. If this parameter is provided,
Expand Down Expand Up @@ -453,10 +454,12 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to
viewerContainer.appendChild(cesiumWidgetContainer);

// Bottom container
var bottomContainer = document.createElement("div");
bottomContainer.className = "cesium-viewer-bottom";

viewerContainer.appendChild(bottomContainer);
var bottomContainer;
if (!defined(options.bottomContainer) || options.bottomContainer !== false) {
bottomContainer = document.createElement("div");
bottomContainer.className = "cesium-viewer-bottom";
viewerContainer.appendChild(bottomContainer);
}

var scene3DOnly = defaultValue(options.scene3DOnly, false);

Expand Down Expand Up @@ -948,7 +951,7 @@ Object.defineProperties(Viewer.prototype, {
* Gets the DOM element for the area at the bottom of the window containing the
* {@link CreditDisplay} and potentially other things.
* @memberof Viewer.prototype
* @type {Element}
* @type {Element | undefined}
* @readonly
*/
bottomContainer: {
Expand Down Expand Up @@ -1642,8 +1645,10 @@ Viewer.prototype.resize = function () {
timeline.resize();
}

this._bottomContainer.style.left = creditLeft + "px";
this._bottomContainer.style.bottom = creditBottom + "px";
if (this._bottomContainer !== undefined) {
this._bottomContainer.style.left = creditLeft + "px";
this._bottomContainer.style.bottom = creditBottom + "px";
}

this._lastWidth = width;
this._lastHeight = height;
Expand Down