Heron

Table Of Contents

Previous topic

Heron.widgets.OpenLSSearchCombo

Next topic

Heron.widgets.ScaleSelectorCombo

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'
                      showRotation: true,                             // Flag for rendering the rotation field
                      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
              }

      });

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