阅读:1441回复:1
怎样在pageLayout控件中实现地图属性显示?
<P>怎样在pageLayout控件中实现地图属性显示?</P>
<P>我尝试了在mapcontrol 控件中能够用Identify,IArray实现,可是以下代码在pageLayout中parray总被赋空值。</P> <P>ESRI.ArcGIS.Geometry.IPoint pPoint = new ESRI.ArcGIS.Geometry.PointClass();<BR> pPoint = axPageLayoutControl1.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(e.x,e.y);<BR> pPoint.SpatialReference=this.axMapControl1.SpatialReference;<BR> <BR> ESRI.ArcGIS.Carto.IIdentify pIdentify = new ESRI.ArcGIS.Carto.FeatureLayerClass();<BR> ESRI.ArcGIS.esriSystem.IArray pArray = new ESRI.ArcGIS.esriSystem.ArrayClass();<BR> ESRI.ArcGIS.Carto.IFeatureIdentifyObj pFeatIdObj = new ESRI.ArcGIS.CartoUI.FeatureIdentifyObjectClass();<BR> ESRI.ArcGIS.Carto.IIdentifyObj pIdObj = new ESRI.ArcGIS.CartoUI.FeatureIdentifyObjectClass();<BR> <BR> ESRI.ArcGIS.Carto.IMap pMap = new ESRI.ArcGIS.Carto.MapClass();<BR> pMap = axPageLayoutControl1.ActiveView.FocusMap;<BR> ESRI.ArcGIS.Carto.ILayer pLayer = pMap.get_Layer(0);<BR> pIdentify = pMap.get_Layer(0) as ESRI.ArcGIS.Carto.IIdentify;</P> <P><BR> <FONT color=#ff0000> pArray</FONT> = pIdentify.Identify(pPoint) as ESRI.ArcGIS.esriSystem.IArray;<BR> if (pArray != null)<BR> {<BR> pFeatIdObj = pArray.get_Element(0) as ESRI.ArcGIS.Carto.IFeatureIdentifyObj;<BR> pIdObj = pFeatIdObj as ESRI.ArcGIS.Carto.IIdentifyObj;<BR> pIdObj.Flash(axPageLayoutControl1.ActiveView.ScreenDisplay);<BR> MessageBox.Show("Layer:" + pIdObj.Layer.Name + "/n" + "Feature:" + pIdObj.Name);<BR> }<BR> else<BR> {<BR> MessageBox.Show("无");<BR> }</P> |
|
1楼#
发布于:2006-08-30 09:36
<P>建议用ISpatialFilter 来查询</P><img src="images/post/smile/dvbbs/em01.gif" />
|
|
|