A gwt-google-apis MapWidget object is not a javascript GMap2 object. A MapWidget is a GWT Widget and contains a GMap2 object inside of it, so you need to use the MapWidget constructor to create it.
On Tue, Feb 1, 2011 at 2:10 PM, Thomas Lefort <lefortho...@gmail.com> wrote: > Me again, there doesn't seem to be much interest in generating > reusable javascript widgets with GWT. If there is let me know, I'll > try to write something about my (painful) experience on this subject. > Anyway, I am now stuck on passing a Map argument to my widget. I use > MapWidget in GWT and the Maps API v2 in the javascript part. I get a > Class cast exception. I am unsure whether or not MapWidget is the > right class to use. > The function specific JSNI: > > private static native void registerPlayMapFunctions(JavaScriptObject > jso) /*-{ > jso.play = function(map) { > return > this.gwt_widg...@com.metaaps.webapps.gwt.playmap.client.PlayMap::play(Lcom/ > google/gwt/maps/client/MapWidget;)(map); > } > }-*/; > The javascript: > var map = new GMap2(document.getElementById("map_canvas")); > var playMap = new PlayMap(); > playMap.play(map); > > Any help would be highly appreciated. > > Thanks, > > Thomas > > > On Feb 1, 1:26 pm, Thomas Lefort <lefortho...@gmail.com> wrote: >> http://code.google.com/p/gwt-google-apis/wiki/VisualizationCustomVisu..., >> gives some insight BTW but you still have to check the code source >> above. And then it looks like the html page will load in two stages in >> any case, with the bootstrap. Might not be very optimum for small >> widgets... I am already on 5k + 90k for a small widget that would >> require just 5k in js. There has to be some optimisation left to be >> done ;-) >> >> On Feb 1, 11:04 am, Thomas Lefort <lefortho...@gmail.com> wrote: >> >> >> >> >> >> >> >> > Looks like this is a pointer to start with: >> >> >http://code.google.com/p/gwt-google-apis/source/browse/trunk/visualiz... >> >> > No doc/guide found so far. >> >> > On Jan 31, 1:12 pm, Thomas Lefort <lefortho...@gmail.com> wrote: >> >> > > I want to write a widget with GWT that can be reused by a javascript >> > > program (in its compiled form). Is there any guide on how to proceed, >> > > eg which classes and methods will be exposed to the user? >> >> > > Thanks, >> >> > > Thomas > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-toolkit@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.