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

8261 - Avoid including Cesium3DTileSet in Picking.js #8532

Merged
merged 9 commits into from
Jan 13, 2020
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Change Log

##### Fixes :wrench:
* Fixed a bug where the camera could go underground during mouse navigation. [#8504](https:/AnalyticalGraphicsInc/cesium/pull/8504)
* Reduced Cesium bundle size by avoiding unnecessarily importing `Cesium3DTileset` in `Picking.js` [#8532](https:/AnalyticalGraphicsInc/cesium/pull/8532)
* Fixed WebGL warning message about `EXT_float_blend` being implicitly enabled. [#8534](https:/AnalyticalGraphicsInc/cesium/pull/8534)

### 1.65.0 - 2020-01-06
Expand Down
12 changes: 12 additions & 0 deletions Source/Scene/Cesium3DTileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,18 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
}

defineProperties(Cesium3DTileset.prototype, {
/**
* NOTE: This getter exists so that `Picking.js` can differentiate between
* PrimitiveCollection and Cesium3DTileset objects without inflating
* the size of the module via `instanceof Cesium3DTileset`
* @private
*/
isCesium3DTileset : {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake for not noticing this in the initial review - the getter should be marked as @private.

get : function() {
return true;
}
},

/**
* Gets the tileset's asset object property, which contains metadata about the tileset.
* <p>
Expand Down
3 changes: 1 addition & 2 deletions Source/Scene/Picking.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import Camera from './Camera.js';
import Cesium3DTileFeature from './Cesium3DTileFeature.js';
import Cesium3DTilePass from './Cesium3DTilePass.js';
import Cesium3DTilePassState from './Cesium3DTilePassState.js';
import Cesium3DTileset from './Cesium3DTileset.js';
import PickDepth from './PickDepth.js';
import PrimitiveCollection from './PrimitiveCollection.js';
import SceneMode from './SceneMode.js';
Expand Down Expand Up @@ -546,7 +545,7 @@ import View from './View.js';
for (var i = 0; i < length; ++i) {
var primitive = primitives.get(i);
if (primitive.show) {
if ((primitive instanceof Cesium3DTileset)) {
if (defined(primitive.isCesium3DTileset)) {
if (!defined(objectsToExclude) || objectsToExclude.indexOf(primitive) === -1) {
tilesets.push(primitive);
}
Expand Down