Skip to content

Commit d9a2935

Browse files
author
Eric Strabala
committed
Fixed labels don't show for individual entities in datasources when clustering is enabled CesiumGS#6087
1 parent 464ce63 commit d9a2935

File tree

3 files changed

+41
-39
lines changed

3 files changed

+41
-39
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Change Log
1010
##### Fixes :wrench:
1111
* 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)
1212
* 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)
13+
* Fixed labels don't show for individual entities in datasources when clustering is enabled #6087
1314

1415
### 1.56.1 - 2019-04-02
1516

CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
6868
* [Nathan Schulte](https://github.com/nmschulte)
6969
* [Jed Fong](https://github.com/jedfong)
7070
* [Brandon McAllister](https://github.com/bmcallis)
71+
* [Eric Strabala](https://github.com/emstrabala)
7172
* [Inovaworks](http://www.inovaworks.com/)
7273
* [Sergio Flores](https://github.com/relfos)
7374
* [CubeWerx Inc.](http://www.cubewerx.com/)

Source/DataSources/EntityCluster.js

+39-39
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
define([
2-
'../Core/BoundingRectangle',
3-
'../Core/Cartesian2',
4-
'../Core/Cartesian3',
5-
'../Core/defaultValue',
6-
'../Core/defined',
7-
'../Core/defineProperties',
8-
'../Core/EllipsoidalOccluder',
9-
'../Core/Event',
10-
'../Core/Matrix4',
11-
'../Scene/Billboard',
12-
'../Scene/BillboardCollection',
13-
'../Scene/Label',
14-
'../Scene/LabelCollection',
15-
'../Scene/PointPrimitive',
16-
'../Scene/PointPrimitiveCollection',
17-
'../Scene/SceneMode',
18-
'../ThirdParty/kdbush'
19-
], function(
20-
BoundingRectangle,
21-
Cartesian2,
22-
Cartesian3,
23-
defaultValue,
24-
defined,
25-
defineProperties,
26-
EllipsoidalOccluder,
27-
Event,
28-
Matrix4,
29-
Billboard,
30-
BillboardCollection,
31-
Label,
32-
LabelCollection,
33-
PointPrimitive,
34-
PointPrimitiveCollection,
35-
SceneMode,
36-
kdbush) {
2+
'../Core/BoundingRectangle',
3+
'../Core/Cartesian2',
4+
'../Core/Cartesian3',
5+
'../Core/defaultValue',
6+
'../Core/defined',
7+
'../Core/defineProperties',
8+
'../Core/EllipsoidalOccluder',
9+
'../Core/Event',
10+
'../Core/Matrix4',
11+
'../Scene/Billboard',
12+
'../Scene/BillboardCollection',
13+
'../Scene/Label',
14+
'../Scene/LabelCollection',
15+
'../Scene/PointPrimitive',
16+
'../Scene/PointPrimitiveCollection',
17+
'../Scene/SceneMode',
18+
'../ThirdParty/kdbush'
19+
], function(
20+
BoundingRectangle,
21+
Cartesian2,
22+
Cartesian3,
23+
defaultValue,
24+
defined,
25+
defineProperties,
26+
EllipsoidalOccluder,
27+
Event,
28+
Matrix4,
29+
Billboard,
30+
BillboardCollection,
31+
Label,
32+
LabelCollection,
33+
PointPrimitive,
34+
PointPrimitiveCollection,
35+
SceneMode,
36+
kdbush) {
3737
'use strict';
3838

3939
/**
@@ -116,8 +116,8 @@ define([
116116

117117
expandBoundingBox(result, pixelRange);
118118

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

133-
if (!defined(item._labelCollection) && defined(item.id) && hasLabelIndex(entityCluster, item.id) && defined(item.id._label)) {
134-
var labelIndex = entityCluster._collectionIndicesByEntity[item.id];
133+
if (!defined(item._labelCollection) && defined(item.id) && hasLabelIndex(entityCluster, item.id.id) && defined(item.id._label)) {
134+
var labelIndex = entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;
135135
var label = entityCluster._labelCollection.get(labelIndex);
136136
label.clusterShow = true;
137137
}

0 commit comments

Comments
 (0)