﻿var JejuMapSmall = {
    ImgPath : null, //지도배경색#FBFAF6
    OrgX : 126.130775,
    OrgY : 33.089417,
    MapWidth : 0.859386,
    MapHeight : 0.491927,
    ImgWidth : 207,
    ImgHeight : 141,
    RatioX : 0.004151623, 
    RatioY : 0.003488844, 
    
    Initialize : function(_imgPath)
    {try{
        JejuMapSmall.ImgPath = _imgPath;                                
    }catch(exx){}},
    //},
    
    ConvertXYtoPoint : function(x, y)
    {try{
        var diffX = x - JejuMapSmall.OrgX;
        var diffY = y - JejuMapSmall.OrgY;
        
        diffX = GUtil.ceilNumber(diffX/JejuMapSmall.RatioX);
        diffY = GUtil.ceilNumber(diffY/JejuMapSmall.RatioY);
        diffY = JejuMapSmall.ImgHeight - diffY; // 위도는 위로 갈수록 증가, 이미지는 아래로 갈수록 증가 하므로
        return new Array(diffX, diffY);
    }catch(exx){}},
    //},

    //지도에 아이콘 표시하기.
    AddPositionMark : function(x, y, title, type)
    {try{
        if(JejuMapSmall.OrgX > x || (JejuMapSmall.OrgX+JejuMapSmall.MapWidth)<x || JejuMapSmall.OrgY > y || (JejuMapSmall.OrgY+JejuMapSmall.MapHeight)<y) return null;
        var xy = JejuMapSmall.ConvertXYtoPoint(x, y);

        var div = document.createElement('div');
        div.style.position = 'absolute';
        div.style.cursor = 'default';
        div.style.border = 0;
        div.style.left = xy[0];
        div.style.top = xy[1];
        div.style.whiteSpace = 'nowrap';
	    
	    if(type=='숙소')
	        div.innerHTML = "<img src='" + JejuMapSmall.ImgPath + "arrowGreen.gif' />" + title;
	    else
	        div.innerHTML = "<img src='" + JejuMapSmall.ImgPath + "arrowViolet.gif' />" +title;
	    
        if(title!=null)
            div.setAttribute('title' , title);
        
	    var divjejumapsmall = $('divjejumapsmall');
        divjejumapsmall.appendChild(div);
        
    }catch(exx){}}
    //}    
}
