<?xml version="1.0" encoding="utf-8"?>
<s:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
		  xmlns:s="library://ns.adobe.com/flex/spark" 
		  xmlns:mx="library://ns.adobe.com/flex/mx"
		  creationComplete="initApp()">
	<fx:Declarations>
		<!-- 将非可视元素（例如服务、值对象）放在此处 -->
	</fx:Declarations>
	<fx:Script>
		<![CDATA[
			import com.esri.ags.Map;
			import com.xt.hb.ais.TuliModel;
			import com.xt.hb.utils.CommonUtility;
			
			import mx.core.FlexGlobals;

			
			private var map:Map;
			
			private function initApp():void
			{
				map = map = FlexGlobals.topLevelApplication.getMap();
			} 
			//清除
			protected function clearAll(event:MouseEvent):void
			{
				FlexGlobals.topLevelApplication.clearAllTempLayer();
			}
			private function btnClick(event:MouseEvent):void
			{
				if(!map)
					map = FlexGlobals.topLevelApplication.getMap();
				var uid:String = event.currentTarget.uid;
				switch(uid)
				{
					case "pan":
					{
						break;
					}
					case "zoonIn":
					{
						map.zoomIn();
						break;
					}
					case "zoomOut":
					{
						map.zoomOut();
						break;
					}
					case "tuli":
					{
						var tuliModel:TuliModel = new TuliModel;
						var width:int = FlexGlobals.topLevelApplication.stage.stageWidth;
						var height:int = FlexGlobals.topLevelApplication.stage.stageHeight;
						var x:Number = width/2-232;
						var y:Number = height/2 - 144;
						CommonUtility.showTitleWindow(tuliModel, false, x, y);
						break;
					}
				}
			}
			
			//图层控制
			private function tckz(event:MouseEvent):void
			{
				FlexGlobals.topLevelApplication.showTCKZModel();
			}
		]]>
	</fx:Script>
	<s:SkinnableContainer id="scaleBar">
		<s:layout>
			<s:VerticalLayout gap="5" />
		</s:layout> 
		<s:SkinnableContainer > 
			<s:HGroup gap="10" horizontalCenter="0" verticalCenter="0">
				<s:Button width="30" height="30" useHandCursor="true" buttonMode="true" toolTip="图层控制"  skinClass="com.skins.tdt.ButtonRectImgSkin"  accessibilityDescription="flexResources/map/tckz.png" click="tckz(event)"  visible="true"/>
				<!--<s:Button width="30" height="30" useHandCursor="true" buttonMode="true" uid="pan" toolTip="平移"  skinClass="com.skins.tdt.ButtonRectImgSkin" accessibilityDescription="flexResources/map/translation.png" click="btnClick(event)"/>-->
				<s:Button width="30" height="30" useHandCursor="true" buttonMode="true" uid="zoonIn" toolTip="拉框放大" skinClass="com.skins.tdt.ButtonRectImgSkin" accessibilityDescription="flexResources/map/zoomin.png" click="btnClick(event)"/>   
				<s:Button width="30" height="30" useHandCursor="true" buttonMode="true" uid="zoomOut" toolTip="拉框缩小" skinClass="com.skins.tdt.ButtonRectImgSkin" accessibilityDescription="flexResources/map/zoomout.png" click="btnClick(event)"/>
				<!--
				<s:Button width="30" height="30" useHandCursor="true" buttonMode="true" toolTip="清除" skinClass="com.skins.tdt.ButtonRectImgSkin" accessibilityDescription="flexResources/map/clear1.png" click="clearAll(event)"/>
				
				<s:Button width="30" height="30" useHandCursor="true" buttonMode="true" uid="tuli" toolTip="图例" skinClass="com.skins.tdt.ButtonRectImgSkin" accessibilityDescription="flexResources/map/viewEntire.png" click="btnClick(event)"/>-->
				
				</s:HGroup>
		</s:SkinnableContainer>
	</s:SkinnableContainer>
</s:Module>
