问题描述
下面这段画线的代码的作用是在地图上根据鼠标的位置画出一条直线现在的问题是我画的线在地图上看不到,是哪里出错了?///鼠标画线///</summary>///<paramname="last">结束点的坐标</param>///<paramname="new1">开始点的坐标</param>publicvoidCreateLine(DPointlast,DPointnew1){try{MapInfo.Mapping.Mapmap=null;if(MapInfo.Engine.Session.Current.MapFactory.Count==0||(map=MapInfo.Engine.Session.Current.MapFactory[0])==null){return;}MultiCurvemulticurve=MultiCurve.CreateLine(mapControl1.Map.GetDisplayCoordSys(),last,new1);Featuref=newFeature(multicurve,newMapInfo.Styles.SimpleLineStyle());MapInfo.Mapping.FeatureLayerworkingLayer=(MapInfo.Mapping.FeatureLayer)map.Layers[0];if(workingLayer!=null){(workingLayer.TableasITableFeatureCollection).Clear();workingLayer.Table.InsertFeature(f);}}catch(System.Runtime.InteropServices.COMExceptionbadCast){}}
解决方案
解决方案二:
你要是确定线写进.tab文件,就试试table.Refresh();
解决方案三:
靠,n年前的贴。