Ticket #2371 (new bug)

Opened 4 years ago

Last modified 3 years ago

webkit: broken image for no tile.

Reported by: fredj Owned by: euzuro
Priority: minor Milestone: 2.13 Release
Component: Tile.Image Version:
Keywords: Cc: arublev
State:

Description

On webkit based browser, if a tile is broken (HTTP error from the remote server) some of the tiles do not have the olImageLoadError css class.

Attachments

image-load-error.html Download (0.8 KB) - added by fredj 4 years ago.
test page to show the issue: all the tiles must have green background.
2371.0.patch Download (1.7 KB) - added by fredj 4 years ago.
new test page, overwrite onImageLoad and onImageLoadError. Because the layer always returns 404 error onImageLoad should never be called. This is the case with FF but not with Chrome or safari on windows.
2371.1.patch Download (2.3 KB) - added by fredj 4 years ago.
change getBrowserName to return "chrome" not "safari"

Change History

Changed 4 years ago by fredj

test page to show the issue: all the tiles must have green background.

  Changed 4 years ago by fredj

Seems to be related to  http://trac.openlayers.org/changeset/5696: setting OpenLayers.Tile.Image.useBlankTile to true fixes the issue

  Changed 4 years ago by fredj

  • component changed from Tile to Tile.Image

follow-up: ↓ 4   Changed 4 years ago by elemoine

OpenLayers.Util.getBrowserName returns safari on my Chromium, so [5696] should take care of setting OpenLayers.Tile.Image.useBlankTile to true!

in reply to: ↑ 3   Changed 4 years ago by fredj

Replying to elemoine:

OpenLayers.Util.getBrowserName returns safari on my Chromium, so [5696] should take care of setting OpenLayers.Tile.Image.useBlankTile to true!

Oups, setting OpenLayers.Tile.Image.useBlankTile to false works for Chromium

Sorry for the confusion ...

  Changed 4 years ago by elemoine

ok, so a patch for this should be pretty straight forward, just modify getBrowserName so it doesn't return "safari" but "chrome" when the browser is Chrome.

Changed 4 years ago by fredj

new test page, overwrite onImageLoad and onImageLoadError. Because the layer always returns 404 error onImageLoad should never be called. This is the case with FF but not with Chrome or safari on windows.

follow-up: ↓ 7   Changed 4 years ago by rdewit

It seems that loading the blank.gif in the 'clear' method causes all the problems: loading that image triggers the onImageLoad event, etc. Do we still need this OpenLayers.Tile.Image.useBlankTile setting? What would break if we just got rid of that completely and also the bit in 'clear' that refers to it? It would make the code easier to understand as well (atm there is no hint in the code to why this useBlankTile has been introduced).

in reply to: ↑ 6   Changed 4 years ago by ahocevar

Replying to rdewit:

Do we still need this OpenLayers.Tile.Image.useBlankTile setting? What would break if we just got rid of that completely and also the bit in 'clear' that refers to it?

Looking at r5696, I'd say it would break Safari and Opera firing onload events without the bit in the clear method.

To me it seems logical to persue what elemoine recommended (make OpenLayers.Util.getBrowserName not return "Safari" for "Chrome").

Changed 4 years ago by fredj

change getBrowserName to return "chrome" not "safari"

  Changed 4 years ago by fredj

attachment:2371.1.patch Download do not fix the issue: apply the patch, load examples/fullScreen.html and resize the browser window -> the tiles are not reloaded.

  Changed 3 years ago by arublev

  • cc arublev added

In any case, the patch fixes the problem of double "onload" events in Google Chrome

  Changed 3 years ago by ahocevar

Addressed in #3419. Not yet closing this issue, because the getBrowserName fix is still valid.

Note: See TracTickets for help on using tickets.