﻿Type.registerNamespace('DDTI.Web.Map.Toolbox');

DDTI.Web.Map.Toolbox.DTMeasureAreaControl = function(element) { 
    DDTI.Web.Map.Toolbox.DTMeasureAreaControl.initializeBase(this, [element]);
}

DDTI.Web.Map.Toolbox.DTMeasureAreaControl.prototype = {
    initialize : function() {
        DDTI.Web.Map.Toolbox.DTMeasureAreaControl.callBaseMethod(this, 'initialize');
        this._onclickHandler = Function.createDelegate(this, this._onClick);
        $addHandlers ( this.get_element(), { 'click' : this._onClick }, this );
    },

    dispose : function() {
        $clearHandlers(this.get_element());
        DDTI.Web.Map.Toolbox.DTMeasureAreaControl.callBaseMethod(this, 'dispose');
    },

    _onClick : function(e) {
        DDTI.Web.Map.Toolbox.DTToolboxComponent.prototype.set_activeTool(DDTI.Web.Map.Toolbox.DTToolTypes.MeasureArea);
    }
}

DDTI.Web.Map.Toolbox.DTMeasureAreaControl.registerClass('DDTI.Web.Map.Toolbox.DTMeasureAreaControl', Sys.UI.Control);

if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();