[Users] print a map doesn't work correctly with my layers

hassane allouch allouch.hassane at gmail.com
Mon May 16 13:58:49 CEST 2011


Hello,

it's works when i used
<script type="text/javascript" src="
http://localhost:8080/geoserver/pdf/info.json?var=printCapabilities
"></script>
thanks

2011/5/15 hassane allouch <allouch.hassane at gmail.com>

> Hello
>
> i tried the exemple:  http://api.geoext.org/1.0/examples/print-extent.html
> (i'm using geoserver 2.1.0)
>
> but i got in the pdf just the title but not the map (i joined it).  with
> the layer
>
> ("Tasmania", "http://demo.opengeo.org/geoserver/wms",
>
>             {layers: "topp:tasmania_state_boundaries"}, {singleTile: true})],
>
> it works, but with mine it doesn't
>
> this is the code:
>
> var mapPanel, printProvider;
>
> Ext.onReady(function() {
>     // The printProvider that connects us to the print service
>     printProvider = new GeoExt.data.PrintProvider({
>         method: "GET", // "POST" recommended for production use
>         capabilities: printCapabilities, // from the info.json script in
> the html
>         customParams: {
>             mapTitle: "Printing Demo",
>             comment: "This is a map printed from GeoExt."
>         }
>     });
>
>     var printExtent = new GeoExt.plugins.PrintExtent({
>         printProvider: printProvider
>     });
>
>     // The map we want to print, with the PrintExtent added as item.
>     mapPanel = new GeoExt.MapPanel({
>         renderTo: "content",
>         width: 450,
>         height: 320,
>         layers: [new OpenLayers.Layer.WMS("
> province",     "http://localhost:8080/geoserver/wms",
>             {layers: "sf:province"}, {singleTile: true})],
>         center: [-7.50,33.5],
>         zoom: 6,
>         plugins: [printExtent],
>         bbar: [{
>             text: "Create PDF",
>             handler: function() {
>                 // the PrintExtent plugin is the mapPanel's 1st plugin
>                 mapPanel.plugins[0].print();
>             }
>         }]
>     });
>     printExtent.addPage();
> });
>
>
> thank you
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110516/30b1da43/attachment.htm 


More information about the Users mailing list