Zn2O / gwt-google-apis

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

Using Icon without setAnchorPoint() throws uncaught/undeclared exception #124

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
r304

Detailed description:

Problem reported by aris:

Hello. Using latest version of GWT 1.5 from SVN (#2866), and latest
version from SVN of gwt-google-apis (#304), with the next code the
application stops running in the .addOverlay(m) line. It doesn’t shows
any exception or error (tried on HostedBrowser, on IE7 and FF2 with
FireBug), but sending comments to the console before and after the
line .addOverlay(m), it shows the comment before that line, but not
the later comment.

MarkerOptions mo = new MarkerOptions();
Icon ic = new Icon("http://192.168.3.148:8080/Images/Map/
mapMarker.png");
mo.setIcon(ic);

Marker m = new Marker(new LatLng(p.latitude,p.longitude), mo);
mapWidget.addOverlay(m);

Workaround if you have one:

Using a Marker() without a MarketOptions()... works ok, but with the
common icon used by markers

...

I made some changes to the sample and found that removing the line

icon.setIconAnchor(new Point(6, 20));

replicates the problem. It stops running without any error.
I just added a .setIconAnchor() to my application, and now it works.

Links to the relevant GWT Developer Forum posts:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/76f592151
d0dd666/7e6c9ffb3ee8d9b6?lnk=gst&q=marker#7e6c9ffb3ee8d9b6

Original issue reported on code.google.com by galgwt.reviews@gmail.com on 21 May 2008 at 12:05

GoogleCodeExporter commented 9 years ago
The attached JS sample replicates the problem outside of GWT.

Original comment by galgwt.reviews@gmail.com on 6 Jun 2008 at 12:31

Attachments:

GoogleCodeExporter commented 9 years ago
Even though this seems to be a problem with the underlying Maps API, it is 
pretty simple to work around in the API.  The problem also exists in the 
Icon(String url) constructor.

Another manual workaround is to create the Icon using new Icon(DEFAULT_ICON) 
and then
change what you want to change.

In investigating this problem I discovered two mis-named methods in Icon that I 
want
to correct before it gets into widespread use:

 setTransparentImageUrl --> setTransparentImageURL
 getTransparentImageUrl --> getTransparentImageURL

and the Size.equals() method was broken (used the Object.equals method).

Original comment by galgwt.reviews@gmail.com on 6 Jun 2008 at 2:21

Attachments:

GoogleCodeExporter commented 9 years ago
Committed as r310

Original comment by galgwt.reviews@gmail.com on 6 Jun 2008 at 3:39

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 13 Oct 2008 at 9:00

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 6 Nov 2008 at 6:42

GoogleCodeExporter commented 9 years ago

Original comment by zundel@google.com on 21 Dec 2009 at 1:57