Hi μακσυδ, I think what you are looking for is the mapId.getPeer() method
http://gwt-google-apis.googlecode.com/svn/javadoc/maps/1.0/com/google/gwt/maps/client/MapWidget.html#getPeer() Originally, the idea was to hide all of the native Maps API objects, but for various reasons, its quite useful to be able to get at them, so the documentation needs to be updated, and more getPeer() methods added in the other wrappers. Getting the object instance back into JavaScript isn't as simple as just dereferencing $wnd.mapId.getPeer(); You'd probably need to do this: private MapWidget mapId; if (Maps.isBrowserCompatible()) { mapId = new MapWidget(); nativeExportMapPeer(mapId.getPeer()); ... } ... // export the native GMap2 object with a JSNI method private static native void nativeExportMapPeer(JavaScriptObject peer) /*-{ $wnd.mapId = peer; }-*/; Regards, -Eric. On Sat, Oct 31, 2009 at 2:41 AM, maksud <[email protected]> wrote: > Looks like none has faced the problem. Then can you recommend other GWT > google map implementations.? > Thanks. > μακσυδ > http://www.commlinkinfotech.com/~maksud > > > On Thu, Oct 29, 2009 at 9:46 AM, maksud <[email protected]> wrote: >> >> Hi, I am using GWT for google map application. I use Google's gwt-maps.jar >> for mapping api. I can create a map as private MapWidget mapId; if >> (Maps.isBrowserCompatible()) { mapId = new MapWidget(); >> mapId.setPixelSize(600, 500); RootPanel.get("gmap").add(mapId); >> mapId.setCurrentMapType(MapType.getHybridMap()); mapId.addControl(new >> LargeMapControl()); mapId.addControl(new MapTypeControl()); >> mapId.addControl(new ScaleControl()); >> mapId.setCenter(LatLng.newInstance(-33.867139, 151.20711), 9); } Now I have >> some legacy javascript code that needed to work on this map object. I want >> to use something like this: $wnd.mapId.addOverlay(ovrlay1); But I cannot get >> this $wnd.mapId variable. Do you know any way to get GMap2 object from >> existing map on some element? It will work if I get the GMap2 instance from >> my "gmap" div. For the time being I am using JSNI to generate all the map >> functionalities. Simmilar to: $wnd.mapId = new >> $wnd.GMap2($wnd.document.getElementById("gmap")); >> >> μακσυδ >> http://www.commlinkinfotech.com/~maksud > > > > > -- 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 [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 -~----------~----~----~----~------~----~------~--~---
