Provides a way to show and modify the extents of print pages on the map. It uses a layer to render the page extent and handle features of print pages, and provides a control to modify them. Must be set as a plugin to a GeoExt.MapPanel.
Sample code to create a MapPanel with a PrintExtent, and print it immediately:
var printExtent = new GeoExt.plugins.PrintExtent({
printProvider: new GeoExt.data.PrintProvider({
capabilities: printCapabilities
})
});
var mapPanel = new GeoExt.MapPanel({
border: false,
renderTo: "div-id",
layers: [new OpenLayers.Layer.WMS("Tasmania", "http://demo.opengeo.org/geoserver/wms",
{layers: "topp:tasmania_state_boundaries"}, {singleTile: true})],
center: [146.56, -41.56],
zoom: 6,
plugins: printExtent
});
printExtent.addPage();
// print the map
printExtent.print();
Configuration properties.
Array of GeoExt.data.PrintPage The pages that this plugin controls. Optional. If not provided, it will be created with one page that is completely contained within the visible map extent.
Note
All pages must use the same PrintProvider.
Public properties.
Public methods.
Parameter: | page – GeoExt.data.PrintPage The page to add to this plugin. If not provided, a page that fits the current extent is created. |
---|---|
Returns: | page :class:GeoExt.data.PrintPage |
Adds a page to the list of pages that this plugin controls.
Parameter: | options – Object Options to send to the PrintProvider’s print method. See GeoExt.data.PrintProvider :: print. |
---|
Prints all pages as shown on the map.
Parameter: | page – GeoExt.data.PrintPage The page to remove from this plugin. |
---|
Removes a page from the list of pages that this plugin controls.
Parameter: | page – GeoExt.data.PrintPage The page to select |
---|
Selects the given page (ie. calls the setFeature on the modify feature control)
Events.
Triggered when a page has been selected using the control
Listener arguments: * printPage - GeoExt.data.PrintPage this printPage