专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Flex

FLEX获取公布的GIS服务测站站点信息

发布时间:2011-06-27 19:20:03 文章来源:www.iduyao.cn 采编人员:星星草
FLEX获取发布的GIS服务测站站点信息
			private function getStcdFour():void
			{	
				
				queryTask.url = "http://"+IPset.ArcGisIP+"/arcgis/rest/services/zhandian/MapServer/2"+"?s="+new Date().getMilliseconds().toString();
				//queryTask.url = "http://"+IPset.ArcGisIP+"/arcgis/rest/services/AnhuiSt/MapServer/0"+"?s="+new Date().getMilliseconds().toString();
				query.where = "stcd<>''";//stcd不为空
				query.returnGeometry = true;
				query.spatialRelationship = "esriSpatialRelIntersects";
				//设置要查询的字段
				var fields:Array = new Array();
				fields.push("STCD");
				fields.push("STNM");
				fields.push("LGTD");
				fields.push("LTTD");
				fields.push("RVNM");//洪河分洪道
				fields.push("HNNM");//洪河
				fields.push("BSNM");//淮河
				fields.push("STTP");//ZQ
				query.outFields = fields;
				//进行查询成功调用onResult方法,错误失败调用onFaut
				queryTask.execute(query,new AsyncResponder(StcdResultD,onFault1));
			}
			
			
			//3-河道水位站-查询结果
			private function StcdResultD(featureSet:FeatureSet,token:Object=null):void{
				featureSet1=featureSet;
				var geo:Geometry;
				stcd="";
				for each(var graphic:Graphic in featureSet.features)
				{					
					geo = graphic.geometry;
					switch(geo.type){	
						case Geometry.MAPPOINT:
							stcd+=graphic.attributes.STCD+",";
							//graphic.addEventListener(MouseEvent.CLICK,refClickFun);
							graphic.addEventListener(MouseEvent.CLICK,showSPAndRainInfo2);
							graphic.symbol=picSymbolC;//绿色三角
							graphicsLayerD.add(graphic);
							
							break;
					}
				}
				
				stcd=stcd.substr(0,stcd.length-1);
				//myService.yuLiangBaoJing(stcd);//wmf
				//Alert.show("stcds:"+stcd);
				//graphicsLayer.visible=true;
				
				//设置图标显示时对应的地图层级数
				var scale:int=CommonFunction.getScaleLevel(map.scale);
				if(scale>=2)
				{
					map.addLayer(graphicsLayerD);
				}
				
			}

private function StcdResultF(featureSet:FeatureSet,token:Object=null):void{
				featureSet1=featureSet;
				var geo:Geometry;
				nameStr="";
				var i=0;
				for each(var graphic:Graphic in featureSet.features)
				{		
					++i;
					geo = graphic.geometry;
					switch(geo.type){	
						case Geometry.MAPPOINT:
							var point:MapPoint=geo as MapPoint;
							nameStr+=graphic.attributes.name+",";
							//graphic.addEventListener(MouseEvent.CLICK,refClickFun);
							graphic.addEventListener(MouseEvent.CLICK,showSPAndRainInfo2);
							//graphic.symbol=picSymbolE;//
							
						    //
							graphic.attributes.hsn=graphic.attributes.hsn+(Math.random()*(20-10)+10).toFixed(1).toString()+"%";
							graphic.attributes.wsr=graphic.attributes.wsr+(Math.random()*(20-10)+10).toFixed(0).toString()+"天";
							graphic.symbol=combSymbol;//组合symbol
							//
							graphicsLayerE.add(graphic);
							//
							var obj:Object={
							id:i,
							stnm:graphic.attributes.name,
								lgtd:point.x.toString(),
								lttd:point.y.toString(),
								hsn:graphic.attributes.hsn,//含水率
								wsr:graphic.attributes.wsr,//无雨日
								addr:graphic.attributes.name+"所在地址"
						   };
							soilArr.addItem(obj);
							//Alert.show("x:"+point.x.toString());
						
							
							break;
					}
					nameStr=nameStr.substr(0,nameStr.length-1);
					//myService.yuLiangBaoJing(stcd);//wmf
					//Alert.show("stcds:"+stcd);
					//graphicsLayer.visible=true;
					
					//设置图标显示时对应的地图层级数
					var scale:int=CommonFunction.getScaleLevel(map.scale);
					if(scale>=2)
					{
						map.addLayer(graphicsLayerE);
					}
					
				}
			}
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: