1 /** 2 * @fileOverview 3 * Copyright (c) 2013 Regione Autonoma della Sardegna 4 * Published under the GPL license.<br> 5 * See <a href="https://sardegnageoportale.it/webgis/license.txt">https://sardegnageoportale.it/webgis/license.txt</a> 6 * for the full text of the license. 7 * @version 0.1 8 */ 9 10 /** 11 * @require plugins/Tool.js 12 * @require GeoExt/widgets/Action.js 13 */ 14 15 /** 16 * @namespace framework.plugins 17 */ 18 Ext.ns("framework.plugins"); 19 20 /** 21 * Component that implements the print functionality extending the MapLinker behavior. 22 * PrintMap redefines the action to perform after the save of map configuration at the moment 23 * started by the click on the print button. 24 * Also it overrides the CSS class that specifies the icon to put on the button with a print icon. 25 * @name_ PrintMap 26 * @class Component that implements the print functionality extending the MapLinker behavior. 27 * @constructor 28 * @extends <a target="_blank" href="framework.plugins.MapLinker.html">framework.plugins.MapLinker</a> 29 */ 30 framework.plugins.PrintMap = Ext.extend(framework.plugins.MapLinker, 31 /** 32 * @lends framework.plugins.PrintMap.prototype 33 */ 34 { 35 /** 36 * framework_printmap plugin type. 37 * @public 38 * @type String 39 */ 40 ptype: "framework_printmap", 41 42 /** 43 * Text for zoom in action tooltip (i18n). 44 * @public 45 * @type string 46 */ 47 tooltipText: "Print map..", 48 49 /** 50 * The prefix of the names of the css classes that define the print icon. 51 * @public 52 * @type String 53 */ 54 iconClsPrefix: "gxp-icon-print-", 55 56 /** 57 * This method opens a new browser tab (or reloads the existing one) showing a map configured 58 * as saved in the confiiguration file by the MapLinker, but formatted to print it on A4 paper. 59 * @public 60 * @param {number} id Id of current map configuration 61 */ 62 useMapConfiguration: function(id) { 63 window.open("print.jsp?map="+id,"Stampa","","true"); 64 } 65 66 }); 67 68 Ext.preg(framework.plugins.PrintMap.prototype.ptype, framework.plugins.PrintMap); 69