I use a default icon.
This is all the code:
MarkerOptions opts = MarkerOptions.newInstance(Icon.DEFAULT_ICON);
opts.setDraggable(true);
final Marker marker= new Marker(latlng,opts);
marker.addMarkerDragEndHandler(new
MarkerDragEndHandler(){
public void
onDragEnd(MarkerDragEndEvent event) {
mpService.reloadInfo(marker.getLatLng().getLatitude(),
marker.getLatLng().getLongitude(), name, new AsyncCallback(){
@Override
public void
onFailure(Throwable caught) {
//
nothing to do
}
@Override
public void
onSuccess(Object result) {
//
nothing to do
}
});
}
});
if (rows==1){
InfoWindow info = map.getInfoWindow();
info.open(marker, new InfoWindowContent(panel));
}
On 11 mar, 19:43, Eric Ayers <[email protected]> wrote:
> Did you create a default marker or did you add a custom icon? If it is the
> latter, you need to set several attributes on it or you'll get weird errors
> like this. You might try searching through the gwt-google-apis group. Does
> this thread help?
>
> https://groups.google.com/group/gwt-google-apis/browse_thread/thread/...
>
>
>
> On Thu, Mar 11, 2010 at 1:30 PM, Fran <[email protected]> wrote:
> > Hi,
>
> > I have a problem with InfoWindow and Google Maps API in GWT.
>
> > If I use this code:
>
> > InfoWindow info = map.getInfoWindow();
> > info.open(marker, new InfoWindowContent(verticalpanel));
>
> > I get a error that I cant understand:
>
> > com.google.gwt.core.client.JavaScriptException: (TypeError): Object
> > [object DOMWindow] has no method 'zc'
> > stack: TypeError: Object [object DOMWindow] has no method 'zc'
> > at
> >http://maps.gstatic.com/intl/es_ALL/mapfiles/208a/maps2.api/main.js:9...
> > at TF.oa (eval at Nh (http://maps.gstatic.com/intl/es_ALL/mapfiles/
> > 208a/maps2.api/main.js:317:40))
> > at wk.<anonymous> (http://maps.gstatic.com/intl/es_ALL/mapfiles/
> > 208a/maps2.api/main.js:1265:57)
> > at wk.<anonymous> (http://maps.gstatic.com/intl/es_ALL/mapfiles/
> > 208a/maps2.api/main.js:1262:120)
> > at
> >http://maps.gstatic.com/intl/es_ALL/mapfiles/208a/maps2.api/main.js:5...
> > at
> >http://maps.gstatic.com/intl/es_ALL/mapfiles/208a/maps2.api/main.js:3...
> > at pd.cT (http://maps.gstatic.com/intl/es_ALL/mapfiles/208a/
> > maps2.api/main.js:304:78)
> > at pd.require (http://maps.gstatic.com/intl/es_ALL/mapfiles/208a/
> > maps2.api/main.js:308:36)
> > at Ed (http://maps.gstatic.com/intl/es_ALL/mapfiles/208a/maps2.api/
> > main.js:318:62)
> > at wk.kv (http://maps.gstatic.com/intl/es_ALL/mapfiles/208a/
> > maps2.api/main.js:1262:31)
> > type: undefined_method
> > arguments: zc,[object DOMWindow]
> > __gwt_ObjectId: 2862
> > at
>
> > com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
> > 195)
> > at
> > com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
> > 120)
> > at
> > com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
> > 507)
> > at
> > com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
> > 264)
> > at
>
> > com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:
> > 91)
> > at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
> > at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
> > at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
> > at
>
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
> > 25)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > at
> > com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
> > at
> > com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
> > at
>
> > com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
> > 157)
> > at
>
> > com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:
> > 1668)
> > at
>
> > com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
> > 401)
> > at
>
> > com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
> > 222)
> > at java.lang.Thread.run(Thread.java:619)
>
> > Help me please, thanks!
>
> > --
> > 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]<google-web-toolkit%[email protected]>
> > .
> > 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
> Sign up now for Google I/O 2010: May 19-20,http://code.google.com/io
--
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.