yugalatea / gwt-google-apis

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

MapWidget.setUItoDefault() can short circuit MapClickHandler #260

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
r1423

Detailed description:

  In the Maps API demo, I noticed that the Map click handler in 3 of the
demos (ClickDemo, ReverseGeocode and MapEventDemo) was not always working.
 If the file was loaded from hosted mode, the click handlers did not fire.
 However, after pressing the 'reload' button, the ClickDemo started to work.  

I suspect a timing/caching issue.  

Workaround if you have one:

  For now, I am working around the problem in the demo by:

  1) Not calling MapWidget.setUItoDefault()
  2) Adding the controls separately.

Links to the relevant GWT Developer Forum posts:

Original issue reported on code.google.com by galgwt.reviews@gmail.com on 5 May 2009 at 6:00

GoogleCodeExporter commented 9 years ago
internal ref 1829355

Note that I have been unable to reproduce this outside the maps demo, with 
neither
straight JavaScript or a small GWT demo.

Original comment by galgwt.reviews@gmail.com on 5 May 2009 at 6:03

GoogleCodeExporter commented 9 years ago
I've reproduced this issue:

- Create any map during module load and put it on the page.  
- Some time after the onModuleLoad() completes and the first map displays, 
create a
second map
- Include a click handler, 
- Use MapWidget.setUItoDefaults().  
- Display the second map on the page.

Although this is not typical for a Maps application, it just so happens that 
our Maps
demo performs all of the following.

Known workarounds.  Any single one of the measures below seems to prevent the 
bug.

- Use a single MapWidget
- If you use multiple map widgets, create them in onModuleLoad(), don't defer
creating them.
- Don't call MapWidget.setUItoDefaults() when you want to use a MapClickHandler
- Turn off the DoubleClickToZoom feature from the MapUIOptions:
    MapUIOptions opts = map.getDefaultUI();
    opts.setDoubleClick(false);
    map.setUI(opts);

Original comment by galgwt.reviews@gmail.com on 6 May 2009 at 2:36

Attachments:

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
A patch was applied to the GWT demo to set the UI options, turning off double 
click as 
shown in the workarounds above.

Original comment by zundel@google.com on 8 Apr 2010 at 6:45