Skip to content

Instantly share code, notes, and snippets.

@akosmaroy
Created March 9, 2014 19:38
Show Gist options
  • Save akosmaroy/9453330 to your computer and use it in GitHub Desktop.
Save akosmaroy/9453330 to your computer and use it in GitHub Desktop.
private void bingCallback(String data) {
byte b[] = data.getBytes();
IByteBuffer bb = new ByteBuffer_WebGL(b, b.length);
onDownloadMetadata(bb);
};
private native void bc(String data) /*-{
var s = JSON.stringify(data);
$wnd.bingCallback(s);
}-*/;
private native void initBing() /*-{
$wnd.bingCallback =
$entry(this.@aero.glass.gwt.client.BingMapsLayer_GWT::bingCallback(Ljava/lang/String;));
$wnd.bc =
$entry(this.@aero.glass.gwt.client.BingMapsLayer_GWT::bc(Ljava/lang/String;));
var script = document.createElement('script');
script.src = 'http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial?key=AnU5uta7s5ql_HTrRZcPLI4_zotvNefEeSxIClF1Jf7eS-mLig1jluUdCoecV7jc&jsonp=$wnd.bc';
document.getElementsByTagName('head')[0].appendChild(script);
}-*/;
public final void initialize(G3MContext context)
{
initBing();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment