[OpenLayers-Users] Inconsistent IE6 results that seem to depend on how page is loaded

palewire ben.welsh at gmail.com
Mon Feb 2 18:52:24 EST 2009


I have an HTML page with OpenLayers JS that loads a KML of multipolygons on
top of a Google maps layer of tiles. It works perfectly in Firefox, but only
displays in certain situations in IE6, driving me somewhat mad.

If I open the page directly (i.e. open a fresh browser, paste in the url,
hit go) it loads perfectly fine 100% of the time. But if I navigate around
some links on my test site (i.e. click a link to another map, or hit the
back button to a previous map), it never loads. Instead giving me the
cryptic error "Error: Failed", "Code: 0".

What could be the cause of this? I encountered some earlier load problems in
IE6, but was able to overcome them by simplifing my polygons to have fewer
coordinates and by making sure I didn't have any divs with the same ID
attribute as my javascript variables. This one has me pulling my hair out
(thanks again, IE).

The maps are being loaded in by a <body onload="init_main_map()"> type of
set up. Could that be affecting things somehow?

My JavaScript is validating perfectly in JSLint. And I'm now trying to chase
down the bug by running through my page in Visual Web Developer Express's
debugger.

The exception seems to be caught on the line of OpenLayers code below and
returning the "failed" exception. My page has two requests, one for the
HTML, and then a second request in the OpenLayers JS for the KML file. The
exception is on that second request for the KML.

Here's the line, no. 185.

try{(this.options['on'+state]||OpenLayers.Ajax.emptyFunction)(response);OpenLayers.Ajax.Responders.dispatch('on'+state,this,response);}catch(e){this.dispatchException(e);}

Unfortunately, I don't know enough about the guts of OpenLayers to have any
clue what might be causing that. If anyone with a clue has a minute, could
you please shed some light on the problem, or at least what the code if
trying to do right there and failing at. The behavior I'm experiencing is
still the same as described above, where the polygons are loading sometimes
in IE6, but not other times, without anything I can discern as rhyme or
reason.

Right now I'm thinking of running away from the problem by rewiring my
JavaScript to load in all of the polygons as distinct WKT objects, and see
if I can just avoid it. But it's still there.

Any lifelines appreciated, per usual.

Thanks much.

-- 
View this message in context: http://n2.nabble.com/Inconsistent-IE6-results-that-seem-to-depend-on-how-page-is-loaded-tp2260954p2260954.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list