Skip to content

Commit dffefca

Browse files
authored
8261 - Avoid including Cesium3DTileSet in Picking.js
1 parent 045151b commit dffefca

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Change Log
2020

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

2526
### 1.65.0 - 2020-01-06

Source/Scene/Cesium3DTileset.js

+12
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,18 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js';
879879
}
880880

881881
defineProperties(Cesium3DTileset.prototype, {
882+
/**
883+
* NOTE: This getter exists so that `Picking.js` can differentiate between
884+
* PrimitiveCollection and Cesium3DTileset objects without inflating
885+
* the size of the module via `instanceof Cesium3DTileset`
886+
* @private
887+
*/
888+
isCesium3DTileset : {
889+
get : function() {
890+
return true;
891+
}
892+
},
893+
882894
/**
883895
* Gets the tileset's asset object property, which contains metadata about the tileset.
884896
* <p>

Source/Scene/Picking.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import Camera from './Camera.js';
2020
import Cesium3DTileFeature from './Cesium3DTileFeature.js';
2121
import Cesium3DTilePass from './Cesium3DTilePass.js';
2222
import Cesium3DTilePassState from './Cesium3DTilePassState.js';
23-
import Cesium3DTileset from './Cesium3DTileset.js';
2423
import PickDepth from './PickDepth.js';
2524
import PrimitiveCollection from './PrimitiveCollection.js';
2625
import SceneMode from './SceneMode.js';
@@ -546,7 +545,7 @@ import View from './View.js';
546545
for (var i = 0; i < length; ++i) {
547546
var primitive = primitives.get(i);
548547
if (primitive.show) {
549-
if ((primitive instanceof Cesium3DTileset)) {
548+
if (defined(primitive.isCesium3DTileset)) {
550549
if (!defined(objectsToExclude) || objectsToExclude.indexOf(primitive) === -1) {
551550
tilesets.push(primitive);
552551
}

0 commit comments

Comments
 (0)