I have added geoxml3.js to my GWT project and added <script type="text/javascript" src="geoxml3.js"></script>
to my host html file.
In my java source file I have:
// KML utils
public final native JavaScriptObject createKmlParser(JavaScriptObject mapId) /*-{
var myParser = new $wnd.geoXML3.parser({
map : mapId
});
return myParser;
}-*/;
public final native void showKml(JavaScriptObject parser, String kml) /*-{
parser.parseKmlString(kml);
}-*/;
public final native void hideKml(JavaScriptObject parser) /*-{
parser.hideDocument();
}-*/;
public void setupKmlLayer(final MapWidget mapWidget) {
final JavaScriptObject jsoParser = createKmlParser(mapWidget.getJso());
try {
showKml(jsoParser, "cta.kml");
} catch (final JavaScriptException jse) {
}
}
and it is being called as:
setupKmlLayer(mapWidget);
KML file is in the same package where this java file is present.
I got the KML file from google's official page : http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml
Any tips please