[Users] PrintPreview Problem: Map is only 1px
Robert Buckley
robertdbuckley at yahoo.com
Mon Mar 28 17:32:08 CEST 2011
Hi,
i am desperately trying to add a simple printing button to my app. Using this
example, I wanted to print the mapPanel with an OSM background, however the map
is only 1px and the pdf is broken.
Here is my app..the print button is in the mappanel´s bottom bar.
http://maps.zgb.de:8080/geoserver/www/testing/wea_kataster.html
here is my code for the mappanel
var mapPanel = new GeoExt.MapPanel({
// title: "Map",
region: "center",
width: 800,
map: map,
layers: [gsat, ghybrid,mapnik, layer, vr_wea],
tbar: [toolbarItems],
bbar: [{
text: "Print...",
handler: function(){
// A window with the PrintMapPanel, which we can use to
adjust
// the print extent before creating the pdf.
printDialog = new Ext.Window({
title: "Print Preview",
width: 350,
height: 500,
items: [{
xtype: "gx_printmappanel",
// use only a PanPanel control
map: {controls: [new
OpenLayers.Control.PanPanel()]},
sourceMap: mapPanel,
printProvider: printProvider
}],
bbar: [{
text: "Create PDF",
handler: function(){
printDialog.items.get(0).print(); }
}]
});
printDialog.show();
}
}]
});
thanks for any hints,
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110328/7310892a/attachment.htm
More information about the Users
mailing list