function JAirMapSpec()
{
	this.tileSize		= 256;
	
	this.minX			= 0;
	this.maxX			= 100000000;
	this.minY			= -10000000;
	this.maxY			= 100000000;
	
	/*
	this.minX			= 0;
	this.maxX			= 999999;
	this.minY			= -100000;
	this.maxY			= 999999;
	*/
	
	this.minLevel		= 1;
	this.maxLevel		= 12;
	this.constant		= 0.5;	// 0.5¸é 1·¹º§ 1ÇÈ¼¿ÀÌ 0.5¹ÌÅÍ
	
	this.CoordType		= "KATECH";
	
	// ¸®¼Ò½º URL
	this.ResourceUrl	= "http://map.wooricy.com/AjaxMap/Resource/";
	// ¸®¼Ò½º URL / ¹Ù´Ù ÀÌ¹ÌÁö
	this.emptyTileUrl	= '/Wooricy/Resource/Image/mapbg.gif';
	// ¸®¼Ò½º URL / µðÆúÆ® ÀÌ¹ÌÁö
	this.preTileUrl		= 'http://map.wooricy.com/AjaxMap/Resource/img/mapbg.png';
	
	// Áöµµ URL
	//this.baseMapUrl		= 'http://ugis247/air/';
	this.baseMapUrl		= 'http://220.95.238.158/air/';
	
	// Áöµµ ´Ù¿î·Îµå URL
	this.downloadUrl	= 'http://imap.wooricy.com/download.php';
}

JAirMapSpec.prototype.setConstant = function (c)
{
	this.constant = c;
};

JAirMapSpec.prototype.distancePerPixel =function (level)
{
	return Math.pow(2, level-1) * this.constant;
};

JAirMapSpec.prototype.getRowCount =function (level)
{
	var dp =	this.distancePerPixel(level);
	var rowImageCount = Math.floor((this.maxX - this.minX)  / (dp * this.tileSize));
	return rowImageCount;
};

JAirMapSpec.prototype.getColCount =function (level)
{
	var dp =	this.distancePerPixel(level);
	var colImageCount = Math.floor((this.maxY - this.minY) / (dp * this.tileSize));
	return colImageCount;
};

JAirMapSpec.prototype.getTileUrl =function(xIndex, yIndex, level) 
{
	var rowImageCount = this.getRowCount(level);
	var colImageCount = this.getColCount(level);
	if (xIndex<0 || yIndex<0 || xIndex >= rowImageCount || yIndex >= colImageCount) 
	{
	    return this.emptyTileUrl;
	}
	
	var imageIndex = yIndex * rowImageCount + xIndex;
	
	var strImageIndex = String(imageIndex)
	var fullpath = "";
	
	fullpath = "/" + String(imageIndex % 1000) + fullpath;
	imageIndex = Math.floor(imageIndex / 1000);
	
	fullpath = "/" + String(imageIndex % 1000) + fullpath;
	imageIndex = Math.floor(imageIndex / 1000);
	
	fullpath = "/" + String(imageIndex % 1000) + fullpath;
	imageIndex = Math.floor(imageIndex / 1000);
	
	fullpath = "/" + String(imageIndex % 1000) + fullpath;
	
	return this.baseMapUrl + level + fullpath + ".png";
};

JAirMapSpec.prototype.getOverlayUrl =function (xIndex,yIndex,level)
{
	return "";
};

JAirMapSpec.prototype.point2pixel =function (point,level,pixel)
{
	if (!pixel)
	{
		pixel = new JPoint();
	}
	var dp =	this.distancePerPixel(level);
	pixel.set(Math.round((point.x - this.minX)/dp),Math.round((point.y - this.minY)/dp));
	return pixel;
};

JAirMapSpec.prototype.pixel2point =function (pixel,level,point)
{
	if (!point)
	{
		point = new JPoint();
	}
	var dp =	this.distancePerPixel(level);
	point.set(Math.round(pixel.x*dp)+this.minX,Math.round(pixel.y*dp)+this.minY);
	return point;
};
