/**
* CHZERO.Control.ZeroMapMeasureErase<br/>
* measure control erase
* @class ZeroMapMeasureErase
* @extends CHZERO.Control
* @constructor
* @namespace CHZERO.Control
* @param {Object} options control 옵션 hashtable
*/
CHZERO.Control.ZeroMapMeasureErase = OpenLayers.Class(OpenLayers.Control.Button, {
CLASS_NAME: 'CHZERO.Control.ZeroMapMeasureErase',
measures: null,
initialize: function(options) {
if (!options) options = {};
if (!options['measures']) options['measures'] = [];
OpenLayers.Control.prototype.initialize.apply(this, [options]);
},
destroy: function() {
this.measures = null;
OpenLayers.Control.prototype.destroy.apply(this, arguments);
},
/**
* @method addMeasure
* @param {CHZERO.Control.ZeroMapMeasure} measure
*/
addMeasure: function(measure) {
this.measures.push(measure);
},
/**
* @method removeMeasure
* @param {CHZERO.Control.ZeroMapMeasure} measure
*/
removeMeasure: function(measure) {
OpenLayers.Util.removeItem(measures, measure);
},
/**
* @method trigger
*/
trigger: function() {
for (var i = 0; i < this.measures.length; i++) {
this.measures[i].deactivate();
this.measures[i].erase();
}
}
});