cgxp.plugins.Print

ptype
cgxp_print
class cgxp.plugins.Print(config)

Example Use

Sample code showing how to add a Print plugin to a gxp.Viewer in a existing container:

new gxp.Viewer({
    ...
    tools: [{
        ptype: 'cgxp_print',
        legendPanelId: "legendPanel",
        featureProvider: "featureGrid",
        outputTarget: "left-panel",
        printURL: "${request.route_url('printproxy', path='')}",
        mapserverURL: "${request.route_url('mapserverproxy', path='')}",
        options: {
            labelAlign: 'top',
            defaults: {
                anchor: '100%'
            },
            autoFit: true
        }
    }]
    ...
});

Sample code showing how to add a Print plugin to a gxp.Viewer via an icon in a toolbar. The print form will show up in a CGXP.tool.Window below the toolbar:

new gxp.Viewer({
    ...
    tools: [{
        ptype: 'cgxp_print',
        legendPanelId: "legendPanel",
        featureProvider: "featureGrid",
        actionTarget: "center.tbar",
        toggleGroup: "maptools",
        printURL: "${request.route_url('printproxy', path='')}",
        mapserverURL: "${request.route_url('mapserverproxy', path='')}",
        options: {
            labelAlign: 'top',
            defaults: {
                anchor: '100%'
            },
            autoFit: true
        }
    }]
    ...
});

Config Options

Configuration properties.

actionTarget

Object or String or Array Where to place the tool’s actions (e.g. buttons or menus)? As opposed to CGXP.plugins.Tool, we don’t want it to be set by default to the mapPanel top toolbar.

borderStyle

Object Style config of the print extent stroke.

checkLegend

Boolean Initial activation status of the legend (default is true).

encodeExternalLayer

Object Additional attribute used to encode external layer. Default to { useNativeAngle: false }

encodeLayer

Object Additional attribute used to encode internal layer. Default to { useNativeAngle: true }

extentStyle

Object Style config of the print extent fill.

featureProvider

String Id of the featureProvider tool.

legendPanelId

String Id of the legendPanel tool.

mapserverURL

String URL of the mapserver proxy.

options

String panel config options.

printProviderConfig

Object Optional parameters to send to the print proxy.

printURL

String URL of the print proxy.

rotateStyle

Object Style config of the rotate icon.

timeout

Integer The timeout delay for the print in milliseconds. Default to 2 minutes.

Public Methods

Public methods.

Print.addActions()

Table Of Contents

Previous topic

cgxp.plugins.Permalink

Next topic

cgxp.plugins.Profile

This Page