Heron.widgets.PrintPreviewWindow

Extends
xtype
hr_printpreviewwindow
class Heron.widgets.PrintPreviewWindow(config)

An ExtJS Window that contains a GeoExt.ux PrintPreview Container. PrintPreview is synced from https://github.com/GeoNode/PrintPreview.

he Window can be opened through the Toolbar (see example) or directly.

 // Via Toolbar printer icon.
{type: "printdialog",
 options: {url: 'http://kademo.nl/print/pdf28992'}
}

// Create PrintPreviewWindow directly.
var printWindow = new Heron.widgets.PrintPreviewWindow({
              title: 'My Title',
              modal: true,
              border: false,
              resizable: false,
              width: 360,
              autoHeight: true,

              hropts: {
                      mapPanel: mapPanel,
                      method: 'POST',
                      url: 'http://kademo.nl/print/pdf28992',
                      legendDefaults: {
                              useScaleParameter : false,
                              baseParams: {FORMAT: "image/png"}
                      },
                      showTitle: true,                                // Flag for rendering the title field
                      mapTitle: 'My Map Title',               // Title string or null
                      mapTitleYAML: 'mapTitle',               // MapFish - field name in config.yaml - default is: 'mapTitle'
                      showComment: true,                              // Flag for rendering the comment field
                      mapComment: 'My Comment text',  // Comment string or null
                      mapCommentYAML: 'mapComment',   // MapFish - field name in config.yaml - default is: 'mapComment'
                      showFooter: false,                              // Flag for rendering the footer field
                      mapFooter: null,                                // Footer string or null
                      mapFooterYAML: 'mapFooter',             // MapFish - field name in config.yaml - default is: 'mapFooter'
                      printAttribution: true,         // Flag for printing the attribution
                      mapAttribution: null,           // Attribution text or null = visible layer attributions
                      mapAttributionYAML: 'mapAttribution', // MapFish - field name in config.yaml - default is: 'mapAttribution'
                      showRotation: true,                             // Flag for rendering the rotation field
                      showOutputFormats: true,                // Flag for rendering the print output formats - default is: false
                      showLegend: true,                               // Flag for rendering the legend checkbox
                      showLegendChecked: false,               // Status of the legend checkbox
                      mapLimitScales: true                    // Limit scales to those that can be previewed
                      mapPreviewAutoHeight: false     // Behavior of the preview map height adjustment
                      mapPreviewHeight: 600          // Static height of the preview map if no automatic height adjustment
              }

      });

emarks

“showTitle: true” and “mapTitle: ‘string’” or “mapTitle: null” :
  • the title edit field will be rendered and but the field will be printed, if it is not empty.
“showTitle: false” and “mapTitle: ‘string’” :
  • the title edit field will not be rendered, but the string will be printed.
“showTitle: false” and “mapTitle: null” :
  • the title edit field will not be rendered and the string will NOT be printed.

Same behavior for the ‘Comment’ and the ‘Footer’ entries.

Events

Events in addition to those listed for Ext.Window.

printexception

Triggered when using the POST method, when the print backend returns an exception.

Listener arguments:

  • printProvider - GeoExt.data.PrintProvider this PrintProvider
  • response - Object the response object of the XHR