Collada model events

73 views
Skip to first unread message

ilikereverb

unread,
Oct 28, 2008, 10:05:39 AM10/28/08
to KML Developer Support - Google Earth Browser Plugin
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

Roman N

unread,
Oct 30, 2008, 7:54:20 PM10/30/08
to KML Developer Support - Google Earth Browser Plugin
Hi David,

Unfortunately there's currently no way of catching events on non-point-
geometry Placemarks; we have a feature request for this at:

http://code.google.com/p/earth-api-samples/issues/detail?id=66

- Roman
Reply all
Reply to author
Forward
0 new messages