[OpenLayers-Users] register "loadend" for kml layer doesn't
work with IE6
Arnd Wippermann
arnd.wippermann at web.de
Thu Jul 24 18:08:35 EDT 2008
Hi Eric, Chris
The page works fine for IE and FF. Only that with IE6 the loadend not works.
I get no error. IE6 seems not willing to register the event.
After loading the kml layer I need to add some attributes to the features
and sometimes to envoke another function to show a solution.
The page are http://gis.ibbeck.de/ginfo/apps/Pentominoes/pentominoes.html
and the problem is, that to show the solutions (Introduction zeigen or show)
for IE6 is not possible, because loadend will not be observed. To start a
new game I always destroy the layer with the pieces and then load the layer
again to get the init position of the pieces.
I have corrected the part with "this".
Arnd
-----Ursprüngliche Nachricht-----
Von: eric.c2c at gmail.com [mailto:eric.c2c at gmail.com]
Gesendet: Donnerstag, 24. Juli 2008 23:16
An: Chris Adams; Arnd Wippermann; users at openlayers.org
Betreff: Re: [OpenLayers-Users] register "loadend" for kml layer doesn't
work with IE6
Chris, i saw that too but thought it should work anyway thanks to the
created closure. Eric
2008/7/24, Chris Adams <chris at genieknows.com>:
> I'm not sure if this is your problem, however there is an error in
> your code.
> ..
>
> lyr.events.register("loadend", lyr, function (e) {
> var objFs = lyr.features;
> for(var i=0;i<objFs.length;i++)
> ..
>
> the line in the middle should be:
> var objFs = this.features;
>
> as the obj param passed to register becomes 'this', and not the name
> of the variable.
>
> Eric Lemoine wrote:
>> Hi. What doesn't work? Do you get an error? Does IE load the page? Is
>> your problem just that your loadend callback gets never called? If
>> it's the latter i really dont know how that could work on FF and not
>> on IE - we have tons of event-related unit tests that just pass on
>> every browser. Sorry for not being helpful here. Cheers. Eric
>>
>> 2008/7/24, Arnd Wippermann <arnd.wippermann at web.de>:
>>
>>> Hi,
>>>
>>> I want to catch the loadend of a kml layer. I tried it this way and
>>> it works for FF, but not for IE6.
>>>
>>> var lyr = new OpenLayers.Layer.GML("Pentominoes", "kml/Pentominoes.kml",
>>> {
>>> format: OpenLayers.Format.KML,
>>> formatOptions: {
>>> extractStyles: true,
>>> extractAttributes: true
>>> }
>>> });
>>>
>>> map.addLayer(lyr);
>>>
>>> lyr.events.register("loadend", lyr, function (e) {
>>> var objFs = lyr.features;
>>> for(var i=0;i<objFs.length;i++)
>>> {
>>> objFs[i].attributes.rotate = 0;
>>> objFs[i].attributes.mirror = 0;
>>> }
>>> if(solutionNo>0)
>>> Solution(solutionNo);
>>> });
>>>
>>> Can anyone show me a solution that works also in IE?
>>>
>>> Arnd Wippermann
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openlayers.org
>>> http://openlayers.org/mailman/listinfo/users
>>>
>>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>>
>>
>
>
More information about the Users
mailing list