Hi.

I have problems printing vector layers with legend. I don't get any error 
messages and my Firebug doesn't show any kind of calls to the server. It 
is as if I didn't issue the print command at all. Without legend, the 
layers print fine. WMS with and without legend works aswell. Any 
suggestions are appreciated.

My setup is as follows:

Geoserver 2.0.2 with print module from 
http://docs.geoserver.org/stable/en/user/community/printing/
Openlayers 2.10
GeoExt 1.0
Firefox 3.6 / Internet Explorer 7
I proxy the http POST using my own c# class.

My code looks something like this (the exact code is longer and 
distributed among several files, but I think this is where the problem 
arise):

    var otherRule = new OpenLayers.Rule({
        name: 'Others',
        elseFilter: true,
        symbolizer: {
            fillColor: "olive",
            strokeColor: "black",
            strokeWidth: 1,
            fillOpacity: 0.5
        }
    });

    var stylemap = new OpenLayers.StyleMap({ "select": { strokeColor: 
"gold", strokeWidth: 3, fillOpacity: 0.2} });
    stylemap.styles["default"].addRules([otherRule]);

    var myVectorLayer = new OpenLayers.Layer.Vector("TV areas", {
        styleMap: stylemap,
        srsName: 'EPSG:'+srs,
        projection: "EPSG:"+srs,
        strategies: [
                new OpenLayers.Strategy.BBOX(),
                tvomraader_wfs_saveStrategy,
                refreshStrategy
             ],
        protocol: new OpenLayers.Protocol.WFS.v1_1_0({
            url: "wfs.aspx",
            featureType: "vw_tvareas",
            featurePrefix: "dandas_dev",
            srsName: "EPSG:"+srs,
            projection: "EPSG:"+srs,
            version: "1.1.0",
            geometryName: 'geom'
        })
    });


mapprintProvider = new GeoExt.data.PrintProvider({
        capabilities: printCapabilities,
        method: 'POST',
        listeners: {
            "print": function (printProvider, url) {
                alert("File created successfully.");
            },
            "printexception": function (printProvider, response) {

                alert("Error during file creation: " + 
response.statusText);
            }
        }
    });

    var printExtent = new GeoExt.plugins.PrintExtent({
        printProvider: mapprintProvider
    });

    var mapPanel = new GeoExt.MapPanel({
        map: map,
        extent: startExtent,
        plugins: [printExtent],
        layers: [OSM, myVectorLayer] //and several other layers, that 
prints fine
    });

mappanel.plugins[0].print({ legend: legendPanel });

Med venlig hilsen / Yours sincerely

Christian Runge
Konsulent





ALECTIA A/S 
Teknikerbyen 34 \ 2830 Virum \ Danmark
Tel: +45 88 191 000 \ Mob: +45 27 618 831 
E-mail: [email protected] \ www.alectia.com



Tænk venligst på miljøet, inden du printer denne email / Please consider 
the environment before printing this email. 


<<image/gif>>

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to