From 21f262644bb653d9628ac8bf75aa64f478758cd1 Mon Sep 17 00:00:00 2001 From: Eric Strabala Date: Mon, 15 Apr 2019 08:40:48 -0500 Subject: [PATCH] Fixed labels don't show for individual entities in datasources when clustering is enabled #6087 --- CHANGES.md | 1 + CONTRIBUTORS.md | 1 + Source/DataSources/EntityCluster.js | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 929799fbc895..6d145e468fa0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 31ede3782b4b..d828faaff691 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -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/) diff --git a/Source/DataSources/EntityCluster.js b/Source/DataSources/EntityCluster.js index 6dddfde31ed8..20910be57032 100644 --- a/Source/DataSources/EntityCluster.js +++ b/Source/DataSources/EntityCluster.js @@ -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); @@ -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; }