-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Description
With a large number of points, PointPrimitiveCollection.removeAll can take a few seconds to hide the points from the scene.
var viewer = new Cesium.Viewer('cesiumContainer');
var numPoints = 100000;
var pointPrimitives = viewer.scene.primitives.add(new Cesium.PointPrimitiveCollection());
var base = viewer.scene.globe.ellipsoid.radii.x;
var color = Cesium.Color.LIGHTSKYBLUE;
var outlineColor = Cesium.Color.BLACK;
for (var j = 0; j < numPoints; ++j) {
var position = new Cesium.Cartesian3(
16000000 * Math.random() - 8000000,
-(4000000 * j / numPoints + base),
2000000 * Math.random() - 1000000);
pointPrimitives.add({
pixelSize : 5,
color : color,
outlineColor : outlineColor,
outlineWidth : 0,
position : position
});
}
var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction(function() {
pointPrimitives.removeAll();
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);Reported in the forum: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/WiFG75oEkFM
thw0rted