谁帮我看看下面的代码有没有什么问题,老是画不出直线来
points包含了直线的两个pointtempLayer = this.axMap1.Layers.CreateLayer("TempLayer", null, 1, 32, this.axMap1.DisplayCoordSys);
tempLayer.ZoomLayer = true;
tempLayer.Visible = true;
this.axMap1.Layers.AnimationLayer = tempLayer;
Feature ftr = this.axMap1.FeatureFactory.CreateLine(points, this.axMap1.DefaultStyle);
this.axMap1.Layers["TempLayer"].AddFeature(ftr,new MapXLib.RowValues());
this.axMap1.Layers.AnimationLayer.Refresh();

解决方案 »

  1.   

       你这样写是有些问题,关键少下面红色部分,把我以前的给你参考下:         
    MapXLib.Feature ftr = new MapXLib.Feature();
                MapXLib.Style newStyle = new MapXLib.Style();
                MapXLib.Layer lyr = axMap1.Layers._Item("SignalLayer");
                MapXLib.FeatureFactory ff = axMap1.FeatureFactory;
                MapXLib.Points pts = new MapXLib.Points();                newStyle.LineWidth = 2;
                    newStyle.LineColor = 255;
                    newStyle.LineStyle = (MapXLib.PenStyleConstants)9;
                    axMap1.AutoRedraw = false;
                    lyr.Editable = true;
                    ftr = ff.CreateLine(pts, newStyle);
    ftr = axMap1.Layers._Item("SignalLayer").AddFeature(ftr, new    MapXLib.RowValuesClass());
                    ftr.Update(ftr, new MapXLib.RowValuesClass());                lyr.Refresh();
                    axMap1.AutoRedraw = true;
      

  2.   

    但是当我运行到红色部分ftr.Update(ftr, new MapXLib.RowValuesClass())之后,突然就跳出我外面的函数了还有几句代码也不执行,是为什么啊,经常出现这种情况,兄弟帮帮忙
      

  3.   

    而且加上这句话axMap1.AutoRedraw = false;后整个地图就死了,但是程序没有死