I&#39;m trying to use an example of printing from openlayers, using javacript and php: <a href="http://trac.osgeo.org/openlayers/wiki/Printing">http://trac.osgeo.org/openlayers/wiki/Printing</a><br><br>A jpg is being generated of the correct size using php, but there is no layer information there. When I look at the post content in Firebug I see:<br>
<br>height    681<br>tiles    []<br>width    1276<br><br>It looks like there is no content for the files being gathered. The relevant javascript seems to be the following:<br><br>    var tiles = [];<br>    for (layername in map.layers) {<br>
        // if the layer isn&#39;t visible at this range, or is turned off, skip it<br>        var layer = map.layers[layername];<br>        if (!layer.getVisibility()) continue;<br>        if (!layer.calculateInRange()) continue;<br>
        // iterate through their grid&#39;s tiles, collecting each tile&#39;s extent and pixel location at this moment<br>        for (tilerow in layer.grid) {<br>            for (tilei in layer.grid[tilerow]) {<br>                var tile     = layer.grid[tilerow][tilei]<br>
                var url      = layer.getURL(tile.bounds);<br>                var position = tile.position;<br>                var opacity  = layer.opacity ? parseInt(100*layer.opacity) : 100;<br>                tiles[tiles.length] = {url:url, x:position.x, y:position.y, opacity:opacity};<br>
            }<br>        }<br>    }<br><br>    // hand off the list to our server-side script, which will do the heavy lifting<br>    var tiles_json = JSON.stringify(tiles);<br><br>I&#39;m not certain if this approach enables me to print the basemap and the layers (both vector and WMS), or whether this code is out of date. Is this the best approach to generate an image of what is seen in the browser?<br>
<br>Thanks,<br>David<br><br>