set selectedEntity

I'm trying to programmatically set the selectedEntity object in the view model.

Essentially, I'm trying achieve programmatically what happens when you click on an entity (i.e: it puts a green box around the object and brings up the infoBox that contains its details).

The pseudo-code would be something like:

viewer.setEntity(entity);

Any help would be GREATLY appreciated!

viewer.selectedEntity = entity is what you want. I recommend you check out the Visualizing Spatial Data tutorial