////////////////////////
// baseopr.js
// 2D Simple
// 地图基本操作
// 王磊 2008-09-16
////////////////////////

//放大
var strZoomIn = "oMapViewer.setCurrentTool(1);";

function zoomInLink()
{
	displayCode(strZoomIn);
}

function runZoomIn()
{
	displayCode(strZoomIn);
	//window.execScript(strZoomIn);
	runCodeBaseOpr(strZoomIn);
}

//缩小
var strZoomOut = "oMapViewer.setCurrentTool(2);";

function zoomOutLink()
{
	displayCode(strZoomOut);
}

function runZoomOut()
{
	displayCode(strZoomOut);
	//window.execScript(strZoomOut);
	runCodeBaseOpr(strZoomOut);
}

//全图
var strWholeMap = "oMapViewer.whole();";

function wholeMapLink()
{
	displayCode(strWholeMap);
}

function runWholeMap()
{
	displayCode(strWholeMap);
	//window.execScript(strWholeMap);
	runCodeBaseOpr(strWholeMap);
}

//漫游
var strMove = "oMapViewer.setCurrentTool(3);";

function moveLink()
{
	displayCode(strMove);
}

function runMove()
{
	displayCode(strMove);
	//window.execScript(strMove);
	runCodeBaseOpr(strMove);
}

//测距
var strMeasureDistance = "oMapViewer.setCurrentTool(oMapViewer.OPER_MEASURE);";

function measureDistanceLink()
{
	displayCode(strMeasureDistance);
}

function runMeasureDistance()
{
	displayCode(strMeasureDistance);
	//window.execScript(strMeasureDistance);
	runCodeBaseOpr(strMeasureDistance);
}

//缩放地图
var strZoomToScale = "oMapViewer.zoomToScale(116.16,40.0,2000000);";

function zoomToScaleLink()
{
	displayCode(strZoomToScale);
}

function runZoomToScale()
{
	displayCode(strZoomToScale);
	//window.execScript(strZoomToScale);
	runCodeBaseOpr(strZoomToScale);
	commonView();
}

//移动实体
var strDisplaceObject = "oMapViewer.setCurrentTool(203);";

function displaceObjectLink()
{
	displayCode(strDisplaceObject);
}

function runDisplaceObject()
{
	displayCode(strDisplaceObject);
	//window.execScript(strDisplaceObject);
	runCodeBaseOpr(strDisplaceObject);
}

///
function displayCode(strCode)
{
	document.getElementById("code").innerHTML = "";
	document.getElementById("code").value = strCode;
}

function runCodeBaseOpr(info)
{
	window.execScript(info);
}
