Hi Hannah,
Thanks that was actually really helpful.
I've now got a version of Viewer.pickEntity that behaves the way I want (won't return things if Entity.pickable is set to false) and it works.. but I have to hack the Cesium code, which is not ideal.
I have tried several different ways to override Viewer.pickEntity from outside cesium but to no avail:
// Doesn't work #1
var viewer = Cesium.Viewer(..);
viewer.pickEntity = function(viewer,e) {...};
// Doesn't work #2
var viewer = Cesium.Viewer(..);
function override_pickEntity(viewer, options) {
alert('mixin called!');
viewer.pickEntity = function(viewer, e) {...};
}
viewer.extend(override_pickEntity, {});
// Doesn't work #3
var orig_Mybasefunction = Cesium.Viewer;
Cesium.Viewer = function(container, options) {
orig_Mybasefunction(container, options);
this.pickEntity = function(viewer, e) { ... }
}
var viewer = Cesium.Viewer(..);
Attempts #1 and #2 seem to do nothing, my pickEntity function is never called. Attempt #3 produces a run-time error.
I don't know JavaScript well enough to understand how you guys are building up your objects, what is the correct way to override this function on my Cesium.Viewer instance?
Thanks,
--Mike