Drill picking polygons causes browser to hang
See original GitHub issueAfter upgrading from 1.38 to 1.39, drill picking certain polygons causes the browser to hang in an infinite loop at this spot in the code.
After quite a bit of debugging, I discovered that this happens on polygons that are missing a height attribute, even though the API says it’s an optional property. To fix the issue in 1.39 apps, you can explicitly set the height of all polygons to 0.0 (the default). This isn’t really a true workaround though, as your polygon will no longer conform to the terrain as it did when you completely omitted the property.
For example, drill-picking the polygon in this Sandcastle example will result in the browser hanging. Add in height: 0.0 and the drill picker will work again (albeit underground if you have terrain enabled).
var viewer = new Cesium.Viewer('cesiumContainer');
var wyoming = viewer.entities.add({
name : 'Wyoming',
show: true,
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArray([
-109.080842,45.002073,
-105.91517,45.002073,
-104.058488,44.996596,
-104.053011,43.002989,
-104.053011,41.003906,
-105.728954,40.998429,
-107.919731,41.003906,
-109.04798,40.998429,
-111.047063,40.998429,
-111.047063,42.000709,
-111.047063,44.476286,
-111.05254,45.002073]),
material : Cesium.Color.RED.withAlpha(0.5)
}
});
viewer.screenSpaceEventHandler.setInputAction(function (movement) {
var picks = viewer.scene.drillPick(movement.position);
if (Cesium.defined(picks)) {
console.log(picks.length);
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
viewer.zoomTo(wyoming);
EDIT: This applies to other primitives too – not just polygons.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)

Top Related StackOverflow Question
@pjcozzi The git bisect result is 8e7b0a6ca479400a747b1dd8173b65a1d00cbe22.
Good eye, thanks @jburr-nc!
@bagnell please look at this for the next release.
@jburr-nc it may be a week or two before we can get to this so feel free to dig even farther in the meantime if you want 😉