﻿//Comportamiento para Mostrar en la barra de estado del navegador las coordenadas correspondientes a la posicion del raton
function WVUTMCoords()
{
    var oThis           = this;
    var viewer          = null;
    var behaviorType    = WVBehaviorType.UTMCOORDS; //tipo de comportamiento
    var enabled        = true;//indica si este comportamiento está operativo para afectar al visor
    this.point          = null;
    lastPoint           = {x:0,y:0};
    
    this.getEnabled=function()
    {
        return enabled;
    }
    
    this.setEnabled=function(enable)
    {
        enabled = true;//enable;
    }
    
    //retorna si el comportamiento debe estar siempre activo
    this.alwaysKeepEnabled=function()
    {
        return enabled;
    }
    
    this.init=function (visor)
    {
        visor = viewer;
    }
    this.getBehaviorType=function()
    {
        return behaviorType;
    }
    this.onUpdate = function ()
    {
        if(this.point == null)return;
        if (lastPoint.x==this.point.x && lastPoint.y==this.point.y) return;
        lastPoint = {x:this.point.x,y:this.point.y};
        window.status = "UTM X: "+this.point.x+",  Y: "+this.point.y;        
    }
    this.finalize=function()
    {
    }
}

