Skip to content

Commit

Permalink
Fixed labels don't show for individual entities in datasources when c…
Browse files Browse the repository at this point in the history
…lustering is enabled CesiumGS#6087
  • Loading branch information
Eric Strabala committed Apr 15, 2019
1 parent 464ce63 commit 21f2626
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Change Log
##### Fixes :wrench:
* Fixed an error where `clampToHeightMostDetailed` or `sampleHeightMostDetailed` would crash if entities were created when the promise resolved. [#7690](https://github.com/AnalyticalGraphicsInc/cesium/pull/7690)
* Fixed an error where many imagery layers within a single tile would cause parts of the tile to render as black on some platforms. [#7649](https://github.com/AnalyticalGraphicsInc/cesium/issues/7649)
* Fixed labels don't show for individual entities in datasources when clustering is enabled #6087

### 1.56.1 - 2019-04-02

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Nathan Schulte](https://github.com/nmschulte)
* [Jed Fong](https://github.com/jedfong)
* [Brandon McAllister](https://github.com/bmcallis)
* [Eric Strabala](https://github.com/emstrabala)
* [Inovaworks](http://www.inovaworks.com/)
* [Sergio Flores](https://github.com/relfos)
* [CubeWerx Inc.](http://www.cubewerx.com/)
Expand Down
8 changes: 4 additions & 4 deletions Source/DataSources/EntityCluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ define([

expandBoundingBox(result, pixelRange);

if (entityCluster._clusterLabels && !defined(item._labelCollection) && defined(item.id) && hasLabelIndex(entityCluster, item.id) && defined(item.id._label)) {
var labelIndex = entityCluster._collectionIndicesByEntity[item.id];
if (entityCluster._clusterLabels && !defined(item._labelCollection) && defined(item.id) && hasLabelIndex(entityCluster, item.id.id) && defined(item.id._label)) {
var labelIndex = entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;
var label = entityCluster._labelCollection.get(labelIndex);
var labelBBox = Label.getScreenSpaceBoundingBox(label, coord, labelBoundingBoxScratch);
expandBoundingBox(labelBBox, pixelRange);
Expand All @@ -130,8 +130,8 @@ define([
function addNonClusteredItem(item, entityCluster) {
item.clusterShow = true;

if (!defined(item._labelCollection) && defined(item.id) && hasLabelIndex(entityCluster, item.id) && defined(item.id._label)) {
var labelIndex = entityCluster._collectionIndicesByEntity[item.id];
if (!defined(item._labelCollection) && defined(item.id) && hasLabelIndex(entityCluster, item.id.id) && defined(item.id._label)) {
var labelIndex = entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;
var label = entityCluster._labelCollection.get(labelIndex);
label.clusterShow = true;
}
Expand Down

0 comments on commit 21f2626

Please sign in to comment.