yugalatea / gwt-google-apis

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

AjaxLoader fails to load Maps API when is back from IE6 history #276

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
Google Maps 1.0 Library
AjaxLoader 1.0 Library
gwt-linux-1.6.4 using as Eclipse plugin
Interner Explorer 6

Detailed description:
To reproduce the bug, use ie6. 

1. Go to the sample project:
http://demo.latest.sharstudiosu.appspot.com/
Hit the button "Load Maps API" and get the alert window as a response.

2. Go to another location in the same window. E.g. http://google.com

3. Hit the "Back" IE button. Try to load Maps second once more. This time
you will fail. 

The code at demo.latest.sharstudiosu.appspot.com is slightly modified
"Default-eclipse-plugin project". These lines are added into onLoad():

        //  START OF TEST CODE ADDON

        if (Maps.isLoaded()) {
            Window.alert("Google Maps are already loaded");
        }

        final Runnable alertii = new Runnable() {
            @Override
            public void run() {
                Window.alert("Grats, Google Maps are loaded via AjaxLoader!");              
            }   
        };

        final ClickHandler mapsLoadHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

Maps.loadMapsApi("ABQIAAAAEAJFbyCpc5MpMuGaIm7BThT_fkghYeX2tTl8X_VRGziAYTApABTqXC
owAQ05Fo9DRnVMmeHFveIAdQ",
"2", false, alertii);               
            }   
        };

        final Button mapsLoadButton = new Button("Load Maps Api");
        mapsLoadButton.addClickHandler(mapsLoadHandler);
        RootPanel.get().add(mapsLoadButton);

        //  END OF TEST CODE ADDON

And
<inherits name="com.google.gwt.maps.GoogleMaps" />
added to the project module file.

Workaround if you have one:

Links to the relevant GWT Developer Forum posts:

Original issue reported on code.google.com by A.A.Vasi...@gmail.com on 6 Jun 2009 at 12:41

GoogleCodeExporter commented 9 years ago
I will look into this.  If that is really the code that is uploaded, I don't
understand why the Maps.isLoaded() stmt. isn't firing.  

The maps API should not need to be reloaded if it is already loaded. I was 
going to
suggest a workaround that you surround your Maps.loadMapsApi() call with this 
test,
and if it is already loaded, call the runnable directly, but I'm not sure that 
will
work - I will test on IE6 on Monday.

Original comment by galgwt.reviews@gmail.com on 6 Jun 2009 at 1:39

GoogleCodeExporter commented 9 years ago
> I will test on IE6 on Monday.

OK

> I don't understand why the Maps.isLoaded() stmt. isn't firing.

Maps.isLoaded() is never fires back from history in:

msie 6.0.2800.1106 (from ie4linux), 

Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9.0.10) Gecko/2009042708
Fedora/3.0.10-1.fc10 Firefox/3.0.10 

Opera/9.80 (X11; Linux i686; U; en) Presto/2.2.15 Version/10.00

However in opera && ff maps api loads OK second time.

> I was going to suggest a workaround that you surround your Maps.loadMapsApi() 
call
with this test, and if it is already loaded, call the runnable directly

That the way my production code works... and fails to load API when is back 
from ie6
history.

Original comment by A.A.Vasi...@gmail.com on 7 Jun 2009 at 4:58

GoogleCodeExporter commented 9 years ago
I was able to reproduce the 'not reloading on back' problem on IE7 using 
straight 
JavaScript this morning.  I did not add the Maps.isLoaded() check.

Original comment by galgwt.reviews@gmail.com on 8 Jun 2009 at 1:43

Attachments:

GoogleCodeExporter commented 9 years ago
Turned over to the Maps API team
Internal ref 1903301

Original comment by galgwt.reviews@gmail.com on 8 Jun 2009 at 2:00

GoogleCodeExporter commented 9 years ago
I believe that there is a very simple workaround to this.  My original example 
had 
the google.load() in the <head> part of the document.  The problem seems to go 
away 
if you move that into the <body> section.

You can try moving your gwt module <script> tag down into the <body> section of 
your 
host page.

Original comment by ericzun...@gmail.com on 9 Jun 2009 at 1:00

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here:

http://www.aikido.nsk.su/trainings/%D0%9D%D0%BE%D0%B2%D0%BE%D1%81%D0%B8%D0%B1%D0
%B8%D1%80%D1%81%D0%BA%D0%B0%D1%8F%20%D0%BE%D0%B1%D0%BB%D0%B0%D1%81%D1%82%D1%8C/

You could see a live app integrated with Google Maps, which works with ie6 
history
exactly as described above. As you can see it's module <script> tag is within 
<body>
section.

Original comment by A.A.Vasi...@gmail.com on 10 Jun 2009 at 4:54

GoogleCodeExporter commented 9 years ago

Original comment by zundel@google.com on 16 Apr 2010 at 3:52

GoogleCodeExporter commented 9 years ago
I´m having the same issue... but my ie is: 8.0.7601.17514

Original comment by dto...@gmail.com on 3 Aug 2011 at 3:20