[OpenLayers-Users] export map issues

DevHour jamie at devhour.net
Thu Aug 12 00:19:01 EDT 2010


Currently I am trying to export maps to a canvas element by using the example posted at http://trac.openlayers.org/browser/sandbox/camptocamp/canvas/openlayers/examples/exportMapCanvas.html  by tsauerwein. So far i've grabbed that html file and the exportMap.js file. The issue i'm having is that it won't export the WMS layers, although it will export vector layers.

I've gone through and tried to debug the script (using Firebug) and this is the part where its failing:

ExportMap.js - line 128 through 136
exportGridLayer: function(layer) {
        if (layer.useCanvas != OpenLayers.Layer.Grid.ONECANVASPERLAYER) {
            return;   
        }
       
        if (layer.canvas != null) {
            this.drawLayer(layer.canvas);   
        }
    },
    
Now it is passing the layer correctly into the function but layer.useCanvas is undefined. So it'll automatically pass over that first if statement, and also layer.canvas is also undefined there so it'll pass over the next if statement as well. Meaning that the layer won't get passed through to the draw canvas. Like I said it works for vectors, just not the others. Is there any reason why these 2 properties (useCanvas and canvas) are both undefined? am I missing a reference to something?

Any help I get will be greatly appreciated!

Cheers


More information about the Users mailing list