[Users] Error while Creating PDF via mapfish-printmodul
Kai Volland
kaivolland at web.de
Thu Jun 16 15:30:17 CEST 2011
Hi everybody,
i try to create a print form where i can type in a title and a comment
quite like this:
http://api.geoext.org/1.0/examples/print-form.html
When i click the "Create PDF"-Button i get this error:
/map.getUnits is not a function/ --> PrintProvider.js (Zeile 383)
I really don't know how i could fix it.
Maybe anyone can help me.
Kind regards
Kai
And here comes the code:
/ // print
// SIMPLEPRINT
var printProvider = new GeoExt.data.PrintProvider({
method: "GET", // "POST" recommended for production use
capabilities: printCapabilities, // provide url instead for
lazy loading
customParams: {
imageurl: "FAKE.png",
}
});
var printPage = new GeoExt.data.PrintPage({
printProvider: printProvider
});
var form = new Ext.FormPanel({
region: "east",
labelWidth: '30%',
frame:true,
title: 'Metadata',
width: '100%',
items:[{
width: '70%',
xtype: "textfield",
fieldLabel: 'Title',
name: 'mapTitle',
plugins: new GeoExt.plugins.PrintPageField({
printPage: printPage
})
},{
width: '70%',
xtype: "textarea",
fieldLabel: 'Comment',
name: 'comment',
plugins: new GeoExt.plugins.PrintPageField({
printPage: printPage
})
}],
buttons:[{
text: 'Create PDF',
handler: function() {
printProvider.print(printPage);
}
}]
});
var action2 = new GeoExt.Action({
map: map,
cls: 'x-btn-text-icon',
tooltip: 'Create PDF',
icon: imagePath + '/pdf.png',
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",
layout: "fit",
width: 350,
autoHeight: true,
items: [{
xtype: "gx_printmappanel",
sourceMap: mappanel,
printProvider: printProvider
},
form
]
});
printDialog.show();
}
});
actions["print"] = action2;
toolbarItems.push(action2);/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110616/db35d594/attachment.htm
More information about the Users
mailing list