vaseems / gwt-google-apis

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

Getting error when using custom Icon for marker #449

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release: GWT 2.1.1, maps api 1.1

Platform information (OS, Browser, GWT version).  Does the issue exist on
other platforms? mac osx 

Give a Detailed description of the problem:
When using a custom icon for a marker it throws an error below. Set the 
infowindow anchor to cancel error.

Icon icon = Icon.getDefaultIcon(); // OR
icon = Icon.newInstance(url);

MarkerOptions options = MarkerOptions.newInstance(icon);
marker = new Marker(position, options);

18:30:47.310 [ERROR] [gonevertical] Uncaught exception escaped
com.google.gwt.event.shared.UmbrellaException: One or more exceptions caught, 
see full set in UmbrellaException#getCauses
    at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:214)
    at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:101)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:103)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:151)
    at com.google.gwt.user.client.ui.CustomButton.onBrowserEvent(CustomButton.java:698)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1264)
    at sun.reflect.GeneratedMethodAccessor51.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.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    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:214)
    at sun.reflect.GeneratedMethodAccessor13.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.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.google.gwt.dom.client.DOMImplStandard.dispatchEvent(DOMImplStandard.java)
    at com.google.gwt.dom.client.Element$.dispatchEvent$(Element.java:127)
    at com.google.gwt.user.client.ui.CustomButton.onClick(CustomButton.java:825)
    at com.google.gwt.user.client.ui.PushButton.onClick(PushButton.java:190)
    at com.google.gwt.user.client.ui.CustomButton.onBrowserEvent(CustomButton.java:656)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1264)
    at sun.reflect.GeneratedMethodAccessor51.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.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    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:214)
    at sun.reflect.GeneratedMethodAccessor13.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.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Thread.java:680)
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError): Result 
of expression 'a' [undefined] is not an object.
 line: 1
 sourceId: 4668058592
 expressionBeginOffset: 16740
 expressionCaretOffset: 16741
 expressionEndOffset: 16743
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.google.gwt.maps.client.impl.__MarkerImplImpl.openInfoWindow(__MarkerImplImpl.java)
    at com.google.gwt.maps.client.InfoWindow.open(InfoWindow.java:327)
    at com.gonevertical.client.layout.maps.geo.GeoItem.editItem(GeoItem.java:240)
    at com.gonevertical.client.layout.maps.geo.GeoItem.access$1(GeoItem.java:231)
    at com.gonevertical.client.layout.maps.geo.GeoItem$3.onClick(GeoItem.java:95)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:54)
    at com.google.gwt.event.dom.client.ClickEvent.dispatch(ClickEvent.java:1)
    at com.google.gwt.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:204)
    at com.google.gwt.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:103)
    at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:101)
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:103)
    at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:116)
    at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:151)
    at com.google.gwt.user.client.ui.CustomButton.onBrowserEvent(CustomButton.java:698)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1264)
    at sun.reflect.GeneratedMethodAccessor51.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.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    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:214)
    at sun.reflect.GeneratedMethodAccessor13.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.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.google.gwt.dom.client.DOMImplStandard.dispatchEvent(DOMImplStandard.java)
    at com.google.gwt.dom.client.Element$.dispatchEvent$(Element.java:127)
    at com.google.gwt.user.client.ui.CustomButton.onClick(CustomButton.java:825)
    at com.google.gwt.user.client.ui.PushButton.onClick(PushButton.java:190)
    at com.google.gwt.user.client.ui.CustomButton.onBrowserEvent(CustomButton.java:656)
    at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
    at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1264)
    at sun.reflect.GeneratedMethodAccessor51.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.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    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:214)
    at sun.reflect.GeneratedMethodAccessor13.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.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Thread.java:680)

Workaround if you have one:
  Set the anchor for the info window to get it to work. Although this won't center it, but it will get it to work.

    // add this to your icon
    Point anchor = Point.newInstance(0, 0);
    icon.setInfoWindowAnchor(anchor);

Links to the relevant Google Group posts:
http://gwt-examples.googlecode.com

Original issue reported on code.google.com by branflak...@gmail.com on 20 Feb 2011 at 2:35

GoogleCodeExporter commented 9 years ago
Unfortunately, that's just the way the Maps API works.  The Maps API isn't that 
good about telling you that you need to set several things on the icon for it 
to work, it just throws the exception.  There is an example of setting a custom 
icon in the HelloMaps sample. 

Original comment by zundel@google.com on 22 Feb 2011 at 2:51

GoogleCodeExporter commented 9 years ago
Thanks for looking into it.

Original comment by branflak...@gmail.com on 22 Feb 2011 at 2:54