<s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
				   xmlns:s="library://ns.adobe.com/flex/spark"
				   xmlns:mx="library://ns.adobe.com/flex/mx"
				   x="0" y="0" width="230" height="100%" backgroundColor="#4fafe4" borderAlpha=".5"
				   borderColor="#afd3f1" borderWeight="1" creationComplete="init();"
				   xmlns:tree="com.tree.*"
				   xmlns:ui="com.xt.hb.views.ui.*" xmlns:ui1="com.xt.hb.ui.*" >
	
	<fx:Style>
		@namespace s "library://ns.adobe.com/flex/spark";
		@namespace mx "library://ns.adobe.com/flex/mx";
		@namespace ic "http://www.supermap.com/iclient/2010";
		@namespace is "http://www.supermap.com/iserverjava/2010";
		.infoStyleName
		{
			backgroundColor:#f8facb;
		}
		
		
		
	</fx:Style>
	<fx:Script source="resLocation.as"/>
	<fx:Script>
		<![CDATA[
			import com.esri.ags.events.DetailsEvent;
			import com.esri.ags.events.ExtentEvent;
			import com.esri.ags.events.ZoomEvent;
			import com.esri.ags.geometry.MapPoint;
			import com.esri.ags.layers.ArcGISDynamicMapServiceLayer;
			import com.esri.ags.layers.FeatureLayer;
			import com.esri.ags.layers.Layer;
			import com.esri.ags.layers.supportClasses.LayerDetails;
			import com.esri.ags.layers.supportClasses.LayerInfo;
			import com.esri.ags.renderers.SimpleRenderer;
			import com.esri.ags.symbols.PictureMarkerSymbol;
			import com.supermap.framework.events.BaseEventDispatcher;
			import com.xt.hb.events.MenusEvent;
			import com.xt.hb.events.NavigationEvent;
			import com.xt.hb.entity.T_R_MENU;
			
			import mx.core.FlexGlobals;
			import mx.events.FlexEvent;
			
			import spark.events.IndexChangeEvent;
			import mx.collections.ArrayCollection;
			
			
			
			private var isXZ:Boolean=false;
			
			//港区规划xml
			private var M_GKGH_GQGH_XML:XML=null;
			//岸线规划xml
			private var M_GKGH_AX_XML:XML=null;
			
			
			
			/**在指定港口范围内的所有港区**/
			private var gqArrInGK:Array=null;
			
			/**市界**/
			private var sjArr:Array=null;
			
			/**港口标注**/
			private var gkptArr:Array=null;
			
			[Bindable]
			private var menuArr:ArrayCollection = new ArrayCollection();
			[Bindable]
			[Embed(source="flexResources/views/folderClosed.png")]
			private var myFolderClosedIcon:Class;
			
			[Bindable]
			[Embed(source="flexResources/views/FolderOpened.png")]
			private var myFolderOpenedIcon:Class;
			
			[Bindable] 
			
			private var gkzyUrl:String;
			
			private function init():void
			{
				var objGkxz:T_R_MENU = new T_R_MENU();
				objGkxz.ID="1";
				objGkxz.CDID = "M_ZYZS_GKDW";
				objGkxz.CDTB = "flexResources/yjpt/list/iconpng.png";
				objGkxz.CDMC = "港口现状";
				menuArr.addItem(objGkxz);
				var objSpjk:T_R_MENU = new T_R_MENU();
				objSpjk.ID="1";
				objSpjk.CDID = "M_ZYZS_SPJK";
				objSpjk.CDTB = "flexResources/map/sxt.png";
				objSpjk.CDMC = "视频监控";
				menuArr.addItem(objSpjk);
				this.initSpjkTree();
				//港口现状定位树：港口、港区、经营人
				this.initLocationTree(true);
			}
			
			public function loadLayersAndFeatures():void
			{
			}
			
			private function locationHandle(event:Event):void
			{
				this.locationAction(event.currentTarget.selectedItem);
			}
			/**
			 * 视频监控节点双击
			 */
			private function spjkHandle(event:Event):void
			{
				this.spjkAction(event.currentTarget.selectedItem);
			}
			/**
			 * 视频监控节点图标双击
			 */
			private function spjkIconHandle(event:Event):void
			{
				//this.spjkIconAction(item);
				this.spjkIconAction(event.currentTarget.selectedItem);
			}		
			[Embed(source="flexResources/map/sxt.png")]  
			public var sxtIcon:Class;  
			
			public var nullIcon:Class;  
			
			// 根据结点的属性设置节点图标  
			private function setIcon(item:Object):*
			{
				if(item.attr=="1")
				{
					return sxtIcon;
				} else {
					return nullIcon;
				}
			}
			
			private function expandJSYTreeNodes():void
			{
				
				
			}
			
			private function menuInit():void
			{
				//弹出框隐藏
				//FlexGlobals.topLevelApplication.axbw.visible=false;
				
				//左侧菜单内容不可见
//				this.locationModel.visible = false;
//				this.locationModel.includeInLayout = false;
				
				this.spjkModel.visible=false;
				this.spjkModel.includeInLayout=false;
			}
			
			
			protected function menuChangeHandler(event:IndexChangeEvent):void
			{
				menuInit();
				//this.map.infoWindow.hide();
				var uid:String = (this.menuBar.selectedItem).CDID;
				// 如果隐藏海事船舶将关闭更新定时器, 暂不做刷新处理
			/* 	if(uid!="M_ZYZS_HSCB"
					&&this.updateHscbTimer.running){
					this.updateHscbTimer.stop() ;
				} */
				if(uid == "M_ZYZS_GKDW")
				{
					this.locationModel.visible = true;
					this.locationModel.includeInLayout = true;
					this.spjkModel.visible=false;
					this.spjkModel.includeInLayout=false;	
					//FlexGlobals.topLevelApplication.axbw.visible=true;
				}
				else if (uid=="M_ZYZS_SPJK")
				{
					this.spjkModel.visible=true;
					this.spjkModel.includeInLayout=true;	
					this.locationModel.visible = false;
					this.locationModel.includeInLayout = false;				
				}
				
			}
			/**
			 *左侧菜单隐藏
			 */  
			protected function hideWin():void
			{
				BaseEventDispatcher.getInstance().dispatchEvent(
					new NavigationEvent(NavigationEvent.MENUCHAGE,"leftHide"));
			}
						
			//扩展集疏运model的那棵树
			protected function jsyModel_contentCreationCompleteHandler(event:FlexEvent):void
			{
//				
			}
			/**
			 * 港口视频树点击事件
			 */ 
			protected function videoTreeClickHandler(event:MouseEvent):void{
			}
			
			private function sourceIsCheckBox(event:Event):Boolean{
				if(event.target.hasOwnProperty("className")&&
					event.target.className=="CheckBox"){
					return true ;
				}
				return false ;
			}
			public function isPortPlanShow():Boolean{
				return true ;
			}
			protected function videoDoubleClickHandler(event:MouseEvent):void{
			}
			
			/**
			 * 危货选中事件
			 */ 
			protected function changeTree():void{
				if(chkWH.selected) {
					this.initLocationTree(true);
				} else {
					this.initLocationTree(false);
				}
			}
			
		]]>
	</fx:Script>
	
	<s:HGroup width="100%" height="100%" gap="0">
		
		
		<s:BorderContainer width="27" height="100%" backgroundColor="#cce8ff" borderVisible="false">
			
			<s:Scroller width="100%" height="100%">
				<s:Group id="myScroller">
					<s:VGroup width="27" height="40" gap="0">
						<s:BorderContainer width="21" height="18" backgroundColor="#c6e1ec"
										   borderAlpha="0" buttonMode="true" click="hideWin();"
										   useHandCursor="true">
							<s:Image buttonMode="true" source="flexResources/ys_46.png"
									 useHandCursor="true"/>
						</s:BorderContainer>
						<s:ButtonBar id="menuBar" buttonMode="true"
									 change="menuChangeHandler(event);"
									 dataProvider="{this.menuArr}" iconField="CDTB"
									 labelField="CDMC" requireSelection="true"
									 skinClass="com.skins.tdt.LeftMenuSkin" useHandCursor="true"> 
							<s:layout>
								<s:VerticalLayout gap="-1" rowHeight="120" variableRowHeight="false"/>
							</s:layout>
						</s:ButtonBar>
					</s:VGroup>
				</s:Group>
			</s:Scroller>
			
		</s:BorderContainer>
		
		
		
		
		<!--港口现状-->
		<s:BorderContainer id="locationModel" visible="true" width="100%" height="100%"
						   backgroundColor="#F5FAFE" borderVisible="false" includeInLayout="true">
			<s:VGroup width="100%" height="100%">
				<s:BorderContainer visible="true" width="100%" height="26"
								   backgroundColor="#CEDBEF" borderVisible="false" includeInLayout="true">
					<s:Label paddingLeft="5" paddingTop="7" height="26" 
							 fontSize="12">危货企业</s:Label><mx:CheckBox 
							 paddingLeft="55" id="chkWH" selected="true"
							 width="100%" height="26" label="" click="changeTree()"/>
				</s:BorderContainer>
				<ui1:TreeWithLines id="locationTree" width="100%" height="100%" borderVisible="false"
							   click="changeTreeNodeState(event)" contentBackgroundColor="#F5FAFE"
							   dataProvider="{this.areaArr}" defaultLeafIcon="{null}"
							   disclosureClosedIcon="{myFolderClosedIcon}"
							   disclosureOpenIcon="{myFolderOpenedIcon}"
							   doubleClick="locationHandle(event);" doubleClickEnabled="true"
							   folderClosedIcon="{null}" folderOpenIcon="{null}" 
							   showDataTips="true" dataTipField="name" labelField="name"
							   rowHeight="30"/>
			</s:VGroup>
		</s:BorderContainer>
		
		<!-- 集疏运
		<s:BorderContainer id="jsyModel" visible="false" width="100%" height="100%"
						   backgroundColor="#F5FAFE" borderVisible="false"
						   contentCreationComplete="jsyModel_contentCreationCompleteHandler(event)"
						   includeInLayout="false">
			<s:Label  width="35%" height="100%" text="地点2" fontSize="13" textAlign="center" verticalAlign="middle"/>
		</s:BorderContainer>-->
		
		<!-- 海事船舶
		<s:BorderContainer id="hsdtModel" visible="false" width="100%" height="100%"
						   backgroundColor="#F5FAFE" borderVisible="false" includeInLayout="false">
			<s:VGroup width="100%" height="100%">
				<ct:CheckBoxTree id="tree_HSCB" width="100%" height="100%" borderVisible="false"
								 checkBoxStateField="STATE" contentBackgroundColor="#F5FAFE"
								 dataProvider="{this.hsdtData}" defaultLeafIcon="{null}"
								 disclosureClosedIcon="{myFolderClosedIcon}"
								 disclosureOpenIcon="{myFolderOpenedIcon}" folderClosedIcon="{null}"
								 folderOpenIcon="{null}" imagePathField="CDTB"
								 itemClick="checkBoxHSCB_click(event)" labelField="CDMC"
								 rowHeight="30" showCheckboxField="showCheckbox" showRoot="false"/>
				
			</s:VGroup>
		</s:BorderContainer>-->
		<!--海事船舶-->
		
		<!--港口规划
		<s:BorderContainer id="gqghModel" visible="false" width="100%" height="100%"
						   backgroundColor="#F5FAFE" borderVisible="false" includeInLayout="false">
		
		</s:BorderContainer>-->	
		<!-- 港口视频
		<s:BorderContainer id="spjkModel" visible="false" width="100%" height="100%"
						   backgroundColor="#F5FAFE" borderVisible="false" includeInLayout="false">
			<ui1:TreeWithLines id="spjkTree" width="100%" height="100%" borderVisible="false"
				   click="changeTreeNodeState(event)" contentBackgroundColor="#F5FAFE"
				   dataProvider="{this.areaVideoArr}" defaultLeafIcon="{null}"
				   iconFunction="setIcon" buttonMode="true"
				   disclosureClosedIcon="{myFolderClosedIcon}"
				   disclosureOpenIcon="{myFolderOpenedIcon}"
				   doubleClick="spjkHandle(event);" doubleClickEnabled="true"
				   folderClosedIcon="{null}" folderOpenIcon="{null}"  
				   showDataTips="true" dataTipField="name" labelField="name"
				   rowHeight="30"/>
		</s:BorderContainer>-->	
		<!-- 港口视频-->	
		<s:BorderContainer id="spjkModel" visible="false" width="100%" height="100%"
		backgroundColor="#F5FAFE" borderVisible="false" includeInLayout="false">
		<ui1:TreeWithIcon id="spjkTree" width="100%" height="100%" borderVisible="false"
		click="changeTreeNodeState(event)" contentBackgroundColor="#F5FAFE"
		dataProvider="{this.areaVideoArr}" defaultLeafIcon="{null}"
		
		disclosureClosedIcon="{myFolderClosedIcon}"
		disclosureOpenIcon="{myFolderOpenedIcon}"
		doubleClick="spjkHandle(event);" doubleClickEnabled="true"
		folderClosedIcon="{null}" folderOpenIcon="{null}"  
		showDataTips="true" dataTipField="name" labelField="name"
		rowHeight="30"/>
		</s:BorderContainer>
		
		
		
		
	</s:HGroup>
</s:BorderContainer>
