[OpenLayers-Users] Problems with Tile.Image and destroy

Eric Lemoine eric.lemoine at camptocamp.com
Thu Jul 23 00:46:48 EDT 2009


On Wednesday, July 22, 2009, Gerhard Dünnebeil
<Gerhard.Duennebeil at chello.at> wrote:
> Hi
>
> fairly new to Openlayers and new to this list so first of all:
>
> Hello to all.
>
> Of course I came here due to a problem :-)
>
> I need help with the following:
>
> I have a image tile provider who isn't providing the complete grid so it
> is "normal" that some tile requests are responded with an error. I'm
> using OpenLayers 2.8.
>
> This works fine on Firefox but leaves tiles with the "image not found"
> icon in Internet Explorer.
>
> My idea was now to hook into the OpenLayers.Util.onImageLoadError
> callback (which works) and to simply delete the tile (which doesn't work).
>
> This is how I do it:
>
> (expert from the code of my special layer constructor)
> ...
>         // We need special error handling for Internet explorer
>         OpenLayers.Util.onImageLoadError = function(args) {
>                OpenLayers.Tile.Image.prototype.destroy.apply(this,
> arguments);

what about 'this.style.display = "none"'

?


Cheers,


>                };
> ...
>
> When my hook is executed it successfully calls "destroy" but fails in it
> when it reaches the line Image.js/140 which is
> "this.layer.events.unregister("loadend", this, this.resetBackBuffer);".
> The problem is that this.layer is undefined.
>
> Can anybody please give me a hint (code example or pointer to
> documentation)  how this can be done better?
>
>
> Thanks and best regards
> Gerhard
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list