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  * @requires plugins/Tool.js
 12  * @require OpenLayers/Control/ZoomBox.js
 13  * @require GeoExt/widgets/Action.js
 14  * @require framework/widgets/control/InfoPoint.js
 15  */
 16 
 17 /**
 18  * @namespace framework.plugins
 19  */
 20 Ext.namespace("framework.plugins");
 21 
 22 /** 
 23  *  Provides actions for infoPoint controll.
 24  *  @name_ PointMarker
 25  *  @class Provides actions for infoPoint controll.
 26  *  @constructor
 27  *  @extends <a target="_blank" href="http://gxp.opengeo.org/master/doc/lib/plugins/Tool.html">gxp.plugins.Tool</a>
 28  */
 29 framework.plugins.PointMarker = Ext.extend(gxp.plugins.Tool, 
 30 /** 
 31  * @lends framework.plugins.PointMarker.prototype 
 32  */
 33 {
 34        /**
 35     * framework_PointMarker plugin type.
 36     * @public
 37     * @type String
 38     */
 39     ptype: "framework_pointmarker",
 40     
 41     /**
 42     * Text for pointMarker box menu item (i18n).
 43     * @public
 44     * @type string
 45     */
 46     menuText: "Point Marker",
 47     
 48     /**
 49     * Text for zoom in action tooltip (i18n).
 50     * @public
 51     * @type string
 52     */
 53     tooltipText: "Inserire un punto nella mappa",
 54     
 55     /**
 56     * class CSS for button element
 57     * @public
 58     * @type string
 59     */
 60     cls: "gxp-icon-point",
 61     
 62     /**
 63     * control of component,
 64     * 
 65     * @public
 66     * @type {Object} 
 67     */
 68    control: null,
 69    
 70    hiddenBtn: false,
 71 
 72     /**
 73     * @private
 74     * @param {Object} config configuration object
 75     */ 
 76     constructor: function(config) {
 77         framework.plugins.PointMarker.superclass.constructor.apply(this, arguments);
 78     },
 79             
 80     /**
 81     * Create and append infoPoint action
 82     * @public
 83     * @returns {framework.plugins.PointMarker} Object with zoom controls inside
 84     */ 
 85     addActions: function() {
 86             var actions = [];
 87             actions.unshift(new GeoExt.Action({
 88                 id: this.idBtn,
 89                 menuText: this.menuText,
 90                 iconCls: this.cls,
 91                 tooltip: this.tooltipText,
 92                 control: this.control,
 93                 map: this.target.mapPanel.map,
 94                 hidden: this.hiddenBtn,
 95                 enableToggle: true,
 96                 allowDepress: true,
 97                 toggleGroup: this.toggleGroup
 98             }));
 99         
100         return framework.plugins.PointMarker.superclass.addActions.apply(this, [actions]);
101     }
102 
103 });
104 
105 Ext.preg(framework.plugins.PointMarker.prototype.ptype, framework.plugins.PointMarker);
106