OpenLayers OpenLayers

Ticket #842 (closed bug: fixed)

Opened 1 year ago

Last modified 1 year ago

Tile.Image should register for abort and cancel events as well as load events

Reported by: crschmidt Assigned to:
Priority: minor Milestone: 2.6 Release
Component: Tile.Image Version: 2.4
Keywords: Cc:
State: Complete

Description

Currently, tile.image does not always correctly report when tiles are loaded, because it does not listen for abort or error events. These should be added, probably in initImgDiv, so that these events fire the loadend for the tile.

Attachments

onabort.html (0.7 kB) - added by ahocevar on 11/05/07 04:40:54.
Simple html page to prove that the onabort event only works in IE. To try, press ESC shortly after saying "ok" to the "start" alert box.
Image.js.patch (1.1 kB) - added by ahocevar on 12/14/07 02:52:12.

Change History

(follow-up: ↓ 3 ) 08/23/07 10:21:59 changed by crschmidt

Okay, cancel and abort events don't seem to do anything in Firefox. Either that, or I'm crazy -- not sure which. Anyone know anything about this?

08/23/07 15:59:19 changed by crschmidt

  • milestone changed from 2.5 Release to 2.6 Release.

Bumping this for 2.6 investigation -- I'm not going to make the time to dig into it before then.

11/05/07 04:40:54 changed by ahocevar

  • attachment onabort.html added.

Simple html page to prove that the onabort event only works in IE. To try, press ESC shortly after saying "ok" to the "start" alert box.

(in reply to: ↑ 1 ) 11/05/07 04:49:04 changed by ahocevar

Replying to crschmidt:

Okay, cancel and abort events don't seem to do anything in Firefox. Either that, or I'm crazy -- not sure which. Anyone know anything about this?

I just spent some time investigating this. The onabort event really does not work in Firefox, Opera and Safari. The attached file "onabort.html" proves this. I also tried to set the img.onabort property directly, which was unsuccessful either. Setting the onabort attribute in the html img tag also does not lead to the expected behaviour.

11/05/07 07:09:55 changed by ahocevar

  • keywords set to review.

I created a patch, as proposed in the initial issue description, to take care of the onerror event. Because the onabort event only seems to work in IE, I did not take care about that.

(follow-up: ↓ 6 ) 12/13/07 23:44:26 changed by crschmidt

  • keywords deleted.

Andreas:

I think this should be 'this.onload()' in the function call, no? We have this bound via the Observe -- I think we should be using it?

(in reply to: ↑ 5 ) 12/14/07 02:51:46 changed by ahocevar

  • keywords set to review.

Replying to crschmidt:

Andreas: I think this should be 'this.onload()' in the function call, no? We have this bound via the Observe -- I think we should be using it?

No but yes. It is defined as var onload = function() {...} , but in the context of Image. So I had to change the patch to do onload.call(this); instead of just onload();.

12/14/07 02:52:12 changed by ahocevar

  • attachment Image.js.patch added.

12/15/07 09:16:18 changed by crschmidt

  • status changed from new to closed.
  • state changed from Review to Complete.
  • resolution set to fixed.

(In [5428]) Tile.Image should register for error events with respect to tile loading events -- this means that if an image fails to load, it will still trigger a loadend event, and the layer will eventually be in a state where it is no longer waiting to load. Thanks to Andreas for the investigation! (Closes #842)