Skip to content

Commit

Permalink
Unselect when picking box is unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Oct 25, 2018
1 parent b6b4307 commit f1a7133
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Apps/Sandcastle/gallery/3D Tiles BIM.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
var picking = false;
Sandcastle.addToggleButton('Per-feature selection', false, function(checked) {
picking = checked;
if (!picking) {
unselectFeature(selectedFeature);
}
});

var selectedFeature;
Expand All @@ -61,6 +64,9 @@
}

function unselectFeature(feature) {
if (!Cesium.defined(feature)) {
return;
}
var element = feature.getProperty('element');
setElementColor(element, Cesium.Color.WHITE);
if (feature === selectedFeature) {
Expand All @@ -76,9 +82,7 @@

var feature = scene.pick(movement.endPosition);

if (Cesium.defined(selectedFeature)) {
unselectFeature(selectedFeature);
}
unselectFeature(selectedFeature);

if (feature instanceof Cesium.Cesium3DTileFeature) {
selectFeature(feature);
Expand Down

0 comments on commit f1a7133

Please sign in to comment.