Is it possible to get events on a collada model the same way you get
events on a standard placemark? The reference for KmlModel suggests
it is, but I have been unable to get it to work.
My code looks like:
function eventListener(event)
{
alert('Got the Click Event!');
event.preventDefault();
}
function finishBoatLoad(kml) {
var boatPlacemark = kml.getFeatures().getChildNodes().item(1);
var boatModel = boatPlacemark.getGeometry();
var boatOrientation = boatModel.getOrientation();
var boatLocation = boatModel.getLocation();
var la =
_ge.getView().copyAsLookAt(_ge.ALTITUDE_RELATIVE_TO_GROUND);
boatLocation.setLatLngAlt(la.getLatitude(), la.getLongitude(),
0.0001);
ge.getFeatures().appendChild(boatPlacemark);
google.earth.addEventListener(boatPlacemark, "click",
eventListener);
}
var MODEL_URL = "
http://localhost:4300/data/boat.kmz";
google.earth.fetchKml(ge, MODEL_URL, finishBoatLoad);
Any help would be appreciated.
David