Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to add print function to my GeoExt 2 web application, like:

first I am testing this using the same example urls, so in app.html I add:

<script type="text/javascript" src=""></script>

then in my js file :

printProvider : Ext.create('', {
            method: "GET", 
            capabilities: printCapabilities,
            customParams: {
                mapTitle: "GeoExt Printing Demo",
                comment: "This demo shows how to use GeoExt.PrintMapPanel"

myP = Ext.create('GeoExt.panel.Map', {
            renderTo: "content",
            width: 500,
            height: 350,
            map: {
                maxExtent: new OpenLayers.Bounds(
                    143.835, -43.648,
                    148.479, -39.574
                maxResolution: 0.018140625,
                projection: "EPSG:4326",
                units: 'degrees'
            layers: [new OpenLayers.Layer.WMS("Tasmania State Boundaries",
                {layers: "topp:tasmania_state_boundaries"},
                {singleTile: true
                 , numZoomLevels: 8
            center: [146.56, -41.56],
            zoom: 0,
            bbar: [{
                text: "Print...",
                handler: function(){
                    // A window with the PrintMapPanel, which we can use to adjust
                    // the print extent before creating the pdf.
                    printDialog = Ext.create('Ext.Window', {
                        title: "Print Preview",
                        layout: "fit",
                        width: 350,
                        autoHeight: true,
                        items: [{
                            xtype: "gx_printmappanel",
                            sourceMap: myP,
                            printProvider: printProvider 
                        bbar: [{
                            text: "Create PDF",
                            handler: function(){ printDialog.items.get(0).print(); }

but I keep getting Cannot read property 'capabilities' of undefined error. I am not sure what I miss here :(

share|improve this question

1 Answer 1

have you tried changing the address of the info.json?

I'm also using Printing functions and I put the address of geoserver printing module

(only if you have geoserver installed locally).

Let me know.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.