Hi,
I've tried to apply the picking billboard example to billboards and polylines I've defined in a czml datasource unsuccessfully. Basically, I'm trying to change the width/color of a polyline or scale of a billboard, when I mouse_over them, then change it back after mouse has passed over the entity. In this example, the "picked" var is global scope. Oddly, this example actually works for the first few mouse_over tries, then it starts to do strange things like intermittently apply red over the cyan color, then eventually it stops working altogether.
function movementHandler() {
var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
handler.setInputAction(function (movement) {
var pickedObject = scene.pick(movement.endPosition);
if (picked != null && Cesium.defined(picked.billboard)) {
picked.billboard.scale.setValue(1.0); //= new Cesium.ConstantProperty(1.0);
picked = null;
} else if (picked != null && Cesium.defined(picked.polyline)) {
picked.polyline.width.setValue(2);
picked.polyline.material.color.setValue(Cesium.Color.CYAN);
picked = null;
}
if (Cesium.defined(pickedObject)) {
if (Cesium.defined(pickedObject.id.billboard)) {
pickedObject.id.billboard.scale.setValue(1.3);
picked = pickedObject.id;
} else if (Cesium.defined(pickedObject.id.polyline)) {
pickedObject.id.polyline.width.setValue(4);
pickedObject.id.polyline.material.color.setValue(Cesium.Color.RED);
picked = pickedObject.id;
}
}
},
Cesium.ScreenSpaceEventType.MOUSE_MOVE
);
}
Maybe I need to recurse through a collection of entities and check to see if my pickedObject is equal to it and manipulate it that way? I haven't figured out where the czml entities are stored though. I know you can manually add things to i.e. PolylineCollection or BillboardCollection, but what "Collection" are items created from czml stored? Thanks in advance!