littlejodo
unread,Nov 4, 2009, 10:27:21 AM11/4/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
I am using the gwt-earth classes to load a google earth instance /
plugin into a GWT project. I noticed that the classes have a parseKml
method, but what I really would like is to use the fetchKml method
that is in the earth javascript api. I have tried creating a
javascript native method to do this. I do not get any errors, yet the
kml is not being shown and I am not sure if it is even being loaded.
Has anyone out there done this? Any advice?
This is the method I am using. It is inside the GoogleEarthWidget
class:
private native void jsFetchKml (String s, GEPlugin plugin) /*-{
var ge;
var instance = this;
function initCB(obj) {
ge = obj;
function finished(object) {
if (!object) {
// wrap alerts in API callbacks and event handlers
// in a setTimeout to prevent deadlock in some browsers
setTimeout(function() {
alert('Bad or null KML.');
}, 0);
plugin.getFeatures().appendChild(object);
return;
}
}
// fetch the KML
var url = s;
google.earth.fetchKml(plugin, url, finished);
}-*/;