I'm wrapping up the Maps V3 api. Any recommendations on modeling it after the core widgets?
Any recommendations on which example to follow for wrapping up the map events? I see Visualizations api code has a nice way of doing it. The underlying widgets of GWT may be it? Reference to Map Event bindings http://code.google.com/apis/maps/documentation/javascript/reference.html#MapsEventListener I think I'll use this, but I'm looking deeper into the GWT core to see if there are better ways? http://code.google.com/p/gwt-google-apis/source/browse/trunk/visualization/visualization/src/com/google/gwt/visualization/client/events/Handler.java If your interested in tracking my progress on my bindings... https://docs.google.com/spreadsheet/ccc?key=0AnyjOBpyOTUWdHpQZTl1UWJUUGxEcjBzYlBEcUVGZUE G+ comments on this: https://plus.google.com/u/0/111739836936169749229/posts/2gNmJPRKmxc So far I've copied the Viz api with this: I'm wondering if it would be better to follow the core event model. public abstract class Handler { /** * TODO * @param w * @param eventName * @param handler */ public static native void addHandler(MapWidget w, String eventName, Handler handler) /*-{ var jso = [email protected]::getJso()(); var callback = function(event) { @com.gonevertical.apis.googlemaps.client.events.Handler::onCallback(Lcom/gonevertical/apis/googlemaps/client/events/Handler;Lcom/google/gwt/ajaxloader/client/Properties;)(handler, event); }; $wnd.google.maps.MapsEventListener.addListener(jso, eventName, callback) }-*/; @SuppressWarnings("unused") private static void onCallback(final Handler handler, final Properties properties) { try { handler.onEvent(properties); } catch (Throwable x) { GWT.getUncaughtExceptionHandler().onUncaughtException(x); } } /** * This method should be overridden by event-specific Handler subclasses. The * subclass should extract the event properties (if any), create a GWT Event * bean object, and pass it to the event-specific callback. * * @param properties The JavaScriptObject containing data about the event. * @throws TypeException If some property of the event has an unexpected type. */ protected abstract void onEvent(Properties properties) throws TypeException; } Thanks Brandon Donnelson http://gwt-examples.googlecode.com http://c.gwt-examples.com -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/hnu2KxcE9F4J. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
