AW: [OpenLayers-Users] Debugging WMS requests in OpenLayers

Arnd Wippermann arnd.wippermann at web.de
Wed Feb 22 12:34:32 EST 2012


Hi,
 
Loop through the grid of the layer and search for the className of the
imgDiv.

function getErrorWMSTile(lyr)
{
    var iTile, kTile, flag;
    for(var i=0;i<lyr.grid.length;i++){
        for(var k=0;k<lyr.grid[i].length;k++){
            var className = (lyr.grid[i][k].imgDiv) ?
lyr.grid[i][k].imgDiv.className : "";
            if(className=="olTileImage olImageLoadError")
            {   flag=true;
                iTile = i;
                kTile = k;
                break;
            }
        }
        if(flag)
            break;
    }
    if(flag){
        return(lyr.grid[iTile][kTile].url);
    }
    else
        return(null);
}
 
var tileUrl = getErrorWMSTile(_aktLayer);
if(tileUrl)
    window.open(tileUrl, "ErrorRequest");

Arnd

________________________________

Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Jan
Hartmann
Gesendet: Mittwoch, 22. Februar 2012 15:59
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] Debugging WMS requests in OpenLayers


Hi,

Is there a way to get te error message for an invalid WMS GetMap request,
such as returned by MapServer? Normally, OpenLayers displays a red bitmap
for the faulty layer, and I need to extract the request from the logfile and
display it in a standalone page. Any way to do this within OpenLayers?

Jan




More information about the Users mailing list