﻿var myPopPath="http://www.syinfo.com.cn/map/ajax/popbuilding.aspx";
var _EyeIconLayer;  
var cEntityPopControl; 
var _PopLayer;         
var vM =    null;   
var vMe =   null;     
var _isBeginSelectMark = false; 
var _isBeginScale = false;
function fnLoadInit()
{
    if(typeof vEdushiMap =='undefined' || typeof veyeEdushiMap=='undefined' || typeof vEdushiMap.Body.NewMapLayer !='function' || typeof veyeEdushiMap.Body.NewMapLayer !='function' )
    {
        setTimeout("fnLoadInit()",50);
        return;
    }
    vM  = vEdushiMap;
    vMe = veyeEdushiMap;
    _PopLayer = vEdushiMap.NewMapLayer('Pop',269, 0);
  
    window.onresize=function()
    {
        if(myMapType=="1")
        {
            var h = fnGetWindowHeight(),w = screen.width-20;
            Autosize();

            if (h<730) h=730;
            var iH = h - 180;
             var iW;
            if(iH <= 730){iH = 730;}
            if (document.getElementById("frmTitle").style.display=="none"){ 
             iW = w - 1;
            }
            else
            {
             iW = w - 308;
            }
            if(iW <= 695){iW = 695;} 
    				
            vM.MapHeight(iH);
            vM.MapWidth(iW);
           
            $('MapBorder').style.height=iH +"px" ;
            $('MapBorder').style.width=iW +"px" ;
            $('EdushiMap').style.width=iW +"px" ;
            $('EdushiMap').style.height=iH +"px" ;
            $('divmapright').style.width=iW +"px" ;
            $('divmapright').style.height=iH+"px"
            $('ft_toola').style.width=iW +"px" ;
        }
        //--GOOGLE
//	    $('map_canvas').style.width=iW +"px" ;
//        $('map_canvas').style.height=iH +"px" ;
//         googlemap.checkResize(); 
//           $('ft_toolb').style.width=iW +"px" ;		
//		$('Eye').style.top=578-135 +'px';
 //    	$('Eye').style.display='block';
//	    $('Ein').style.bottom=1 +'px';
//	     $('Ein').style.right=298 +'px';
//	     $('Eye').style.right=298 +'px';

    };
    if(myMapType=="1")
    {
        setTimeout('window.onresize();', 100);
    }
    _EyeIconLayer = vMe.NewMapLayer('Icon', 264, 0);
  
        var EyeZB = new fnZoomBar();
    EyeZB.Init();
    vM.onMapZoomChange = function(z){
      EyeZB.ZoomBarSignPos(vM.Zoom());
      vMe.FlatZoom(vM.Zoom());
    };

    vM.onPaneEnd = function (x1,y1,x2,y2,flg){
        if(flg==0){
           fnShowPaneSearch(x1,y1,x2,y2);
        }        
    };
    vM.onMapMouseUp = function(e){
        if (_isBeginSelectMark){
            _Mark.Mark(vM.PointerX(),vM.PointerY(),'');
        }
    };
    vM.onMapDblClick = function(e){
        if (!_isBeginScale){
            if (vM.Zoom() >0){
                vM.MoveTo(vM.PointerX(),vM.PointerY());
                vMe.MoveTo(vM.PointerX(),vM.PointerY());
                vM.FlatZoom(0);
            }
            else{
                vM.MoveTo(vM.PointerX(),vM.PointerY(),true);
                vMe.MoveTo(vM.PointerX(),vM.PointerY(),true);
            }
        }
        _isBeginScale = false; 
    };
    vMe.onMapMoveEnd = function(x,y,flg){
        if(flg==0){vM.MoveTo(x,y,true);}
    };
    vM.onMapMoveEnd = function(x,y,flg){
        if(flg==0){vMe.MoveTo(x,y,true);}
    };
 
  vM.onSpotLabelClick = function(spot){
           //alert(spot.ID);
           if (spot.Oaddress==0)
           {
            ShowOwnerInfoPop(spot);
           }
              
            };  
           
}

        