[OpenLayers-Users] how to capture LoadImagerror

Andreas Hocevar ahocevar at opengeo.org
Sat Jan 21 08:07:26 EST 2012


Currently there is no clean way to do this, but the following should
work in all browsers except IE < 9 (untested):

layer.events.register("tileloaded", this, function() {
    if (document.getElementsByClassName("olImageLoadError").length) {
        /* your error handling code here */
    }
});

Note that if you only want to change the appearance of a broken tile,
it is enough to add some css for the .olImageLoadError selector.

Andreas.

On Sat, Jan 21, 2012 at 1:45 PM, francescoboccacci at libero.it
<francescoboccacci at libero.it> wrote:
> Hi all,
> i'd like capture a map event when a tile is broken (404). Is ther a event to
> capture it and run my function?
> Thanks
>
> Francesco
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list