yugalatea / gwt-google-apis

Automatically exported from code.google.com/p/gwt-google-apis
0 stars 0 forks source link

Maps API: GoogleBarOptions needs callback methods #263

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
gwt-maps 1.0.4

Detailed description:
The callback methods in GoogleBarOptions were left unimplmented

Workaround if you have one:
Since GoogleBarOptions is a JavaScriptObject subclass, you can add these
properties with a JSNI method.  Here is an (untested!) suggestion:

// Java code to be called back when the callback fires
private static void callback(JavaScriptObject markerObject) {
  // Wraps the JSO as a marker.  This can only be done once per marker
  Marker marker = Marker.createPeer(markerObject);
}

// Add the callback property to the GoogleBarOptions
private static native void 
addonGenerateMarkerHtmlCallback(GoogleBarOptions options) {
  options.onGenerateMarkerHtmlCallback = function (markerObject) {

@com.example.MyClass.callback(Lcom/google/gwt/core/client/JavaScriptObject;)(mar
kerObject);
  };
}

// Sample usage:

GoogleBarOption options = GoogleBarOptions.newInstance(
...
addOnGenerateCallback(options);

Links to the relevant GWT Developer Forum posts:

Original issue reported on code.google.com by galgwt.reviews@gmail.com on 8 May 2009 at 1:43

GoogleCodeExporter commented 9 years ago

Original comment by zundel@google.com on 21 Dec 2009 at 1:32

GoogleCodeExporter commented 9 years ago
Maps v2 has been deprecated.

Original comment by zundel@google.com on 28 Oct 2011 at 3:59