[Users] print a map doesn't work correctly with my layers
hassane allouch
allouch.hassane at gmail.com
Sun May 15 15:57:14 CEST 2011
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/20110515/c642c6d9/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mapfish-print(5).pdf
Type: application/pdf
Size: 1517 bytes
Desc: not available
Url : http://www.geoext.org/pipermail/users/attachments/20110515/c642c6d9/attachment.pdf
More information about the Users
mailing list