<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi everybody,<br>
<br>
i try to create a print form where i can type in a title and a
comment quite like this:<br>
<a class="moz-txt-link-freetext" href="http://api.geoext.org/1.0/examples/print-form.html">http://api.geoext.org/1.0/examples/print-form.html</a><br>
<br>
When i click the "Create PDF"-Button i get this error:<br>
<br>
<font color="#cc0000"><i><span role="presentation" class="objectBox
objectBox-errorMessage hasBreakSwitch "><span
class="errorMessage ">map.getUnits is not a function</span></span></i></font>
--> PrintProvider.js (Zeile 383)<br>
<br>
I really don't know how i could fix it.<br>
<br>
Maybe anyone can help me.<br>
<br>
Kind regards<br>
<br>
Kai<br>
<br>
And here comes the code:<br>
<br>
<i> // print<br>
// SIMPLEPRINT<br>
<br>
var printProvider = new GeoExt.data.PrintProvider({<br>
method: "GET", // "POST" recommended for production use<br>
capabilities: printCapabilities, // provide url instead
for lazy loading<br>
customParams: {<br>
imageurl: "FAKE.png",<br>
}<br>
});<br>
<br>
var printPage = new GeoExt.data.PrintPage({<br>
printProvider: printProvider<br>
});<br>
<br>
<br>
var form = new Ext.FormPanel({<br>
region: "east",<br>
labelWidth: '30%',<br>
frame:true,<br>
title: 'Metadata',<br>
width: '100%',<br>
items:[{<br>
width: '70%',<br>
xtype: "textfield",<br>
fieldLabel: 'Title',<br>
name: 'mapTitle',<br>
plugins: new GeoExt.plugins.PrintPageField({<br>
printPage: printPage<br>
})<br>
},{<br>
width: '70%',<br>
xtype: "textarea",<br>
fieldLabel: 'Comment',<br>
name: 'comment',<br>
plugins: new GeoExt.plugins.PrintPageField({<br>
printPage: printPage<br>
})<br>
}],<br>
buttons:[{ <br>
text: 'Create PDF',<br>
handler: function() {<br>
printProvider.print(printPage);<br>
}<br>
}]<br>
});<br>
<br>
<br>
<br>
var action2 = new GeoExt.Action({<br>
map: map,<br>
cls: 'x-btn-text-icon',<br>
tooltip: 'Create PDF',<br>
icon: imagePath + '/pdf.png',<br>
handler: function(){<br>
// A window with the PrintMapPanel, which we can use
to adjust<br>
// the print extent before creating the pdf.<br>
printDialog = new Ext.Window({<br>
title: "Print Preview",<br>
layout: "fit",<br>
width: 350,<br>
autoHeight: true,<br>
items: [{<br>
xtype: "gx_printmappanel",<br>
sourceMap: mappanel,<br>
printProvider: printProvider<br>
},<br>
form<br>
]<br>
});<br>
printDialog.show();<br>
}<br>
});<br>
actions["print"] = action2;<br>
toolbarItems.push(action2);</i><br>
</body>
</html>