试用mapxtreme 2005 v6.6中的一个问题

用mapxtreme 2005 v6.6中的模板建了一个工程,加了一个临时表,加上一些工具,如放大缩小之类的。

在操作了几次放大缩小后,它就不工作了,哪位用过的,知道是什么原因 ?
以下是出错界面

未将对象引用设置到对象的实例。

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。

源错误:

[没有相关的源行]

源文件: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d8e8a4a2\33210ac3\App_Web_-y-moa2u.0.cs    行: 0

堆栈跟踪:

[NullReferenceException: 未将对象引用设置到对象的实例。]
            MapStateManager.AppStateManager.GetMapObj(String mapAlias) +31
            MapStateManager.AppStateManager.SaveState() +42
            _Default.Page_UnLoad(Object sender, EventArgs e) +11
            System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
            System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
            System.Web.UI.Control.OnUnload(EventArgs e) +2065532
            System.Web.UI.Control.UnloadRecursive(Boolean dispose) +267
            System.Web.UI.Page.UnloadRecursive(Boolean dispose) +20
            System.Web.UI.Page.ProcessRequestCleanup() +40
            System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154
            System.Web.UI.Page.ProcessRequest() +86
            System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
            System.Web.UI.Page.ProcessRequest(HttpContext context) +49
            ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d8e8a4a2\33210ac3\App_Web_-y-moa2u.0.cs:0
            System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
            System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
            



 

版本信息: Microsoft .NET Framework 版本:2.0.50727.42; ASP.NET 版本:2.0.50727.42


以下是部份程序

 MapInfo.Data.TableInfoMemTable tblInfoTemp = new MapInfo.Data.TableInfoMemTable("Animation");
        MapInfo.Data.Table tblTemp = MapInfo.Engine.Session.Current.Catalog.GetTable("Animation");
        if (tblTemp != null)
        {
            MapInfo.Engine.Session.Current.Catalog.CloseTable("Animation");
        }
        tblInfoTemp.Columns.Add(MapInfo.Data.ColumnFactory.CreateFeatureGeometryColumn(myMap.GetDisplayCoordSys()));
        tblInfoTemp.Columns.Add(MapInfo.Data.ColumnFactory.CreateStyleColumn());
        tblInfoTemp.Columns.Add(MapInfo.Data.ColumnFactory.CreateStringColumn("显示", 64));    
        tblInfoTemp.Columns.Add(MapInfo.Data.ColumnFactory.CreateStringColumn("编号", 8));
        tblInfoTemp.Columns.Add(MapInfo.Data.ColumnFactory.CreateStringColumn("设备编号", 8));
        tblTemp = MapInfo.Engine.Session.Current.Catalog.CreateTable(tblInfoTemp);
        FeatureLayer lyr = new FeatureLayer(tblTemp);
        myMap.Layers.Add(lyr);
        //以上为创建临时表

        MapInfo.Styles.FontPointStyle _fontSymbol = new MapInfo.Styles.FontPointStyle();
        _fontSymbol.Code = 93;
        _fontSymbol.PointSize = 24;
        _fontSymbol.Color = System.Drawing.Color.Purple;
//        _fontSymbol.Font.Name = "MapInfo Transportation";
        _fontSymbol.Font.Name = "Uniwill";
        _fontSymbol.Font.FontWeight = MapInfo.Styles.FontWeight.Bold;
        _fontSymbol.Angle = -450;

        MapInfo.Styles.FontPointStyle _fontSymbol2 = new MapInfo.Styles.FontPointStyle();
        _fontSymbol2.Code = 94;
        _fontSymbol2.PointSize = 24;
        _fontSymbol2.Color = System.Drawing.Color.Purple;
        _fontSymbol2.Font.Name = "Uniwill";
        _fontSymbol2.Font.FontWeight = MapInfo.Styles.FontWeight.Bold;
        _fontSymbol2.Angle = 900;

        //以上为创建点样式
       
        FeatureGeometry pt3 = new MapInfo.Geometry.Point(lyr.CoordSys, new DPoint(x, y)) as FeatureGeometry;
        MapInfo.Styles.CompositeStyle cs3 = new MapInfo.Styles.CompositeStyle(new MapInfo.Styles.SimpleVectorPointStyle(20, System.Drawing.Color.Red, 10));
               
        MapInfo.Data.Feature ftr3 = new MapInfo.Data.Feature(tblTemp.TableInfo.Columns);
        ftr3.Geometry = pt3;
        cs3.SymbolStyle = _fontSymbol;
       
        ftr3.Style = cs3;
       
        ftr3["编号"] = "辽A12345";
        ftr3["设备编号"] = "1391234567";
        ftr3["显示"] = ftr3["编号"] + "\n" + ftr3["设备编号"];

        FeatureGeometry pt2 = new MapInfo.Geometry.Point(lyr.CoordSys, new DPoint(x + 0.02, y + 0.02)) as FeatureGeometry;
        MapInfo.Styles.CompositeStyle cs2 = new MapInfo.Styles.CompositeStyle(new MapInfo.Styles.SimpleVectorPointStyle(20, System.Drawing.Color.Red, 10));
        MapInfo.Data.Feature ftr2 = new Feature(tblTemp.TableInfo.Columns);
        ftr2.Geometry = pt2;
        cs2.SymbolStyle = _fontSymbol2;
        ftr2.Style = cs2;
        ftr2["编号"] = "辽A12345";
        ftr2["设备编号"] = "1391234567";
        ftr2["显示"] = ftr3["编号"] + "\n" + ftr3["设备编号"];
        
        //以上为创建点

        //显示点
        tblTemp.InsertFeature(ftr3);
        tblTemp.InsertFeature(ftr2);


        MapInfo.Styles.TextStyle _textSymbol = new MapInfo.Styles.TextStyle();
        _textSymbol.Font.ForeColor = Color.Red;
        _textSymbol.Font.Size = 8;
        LabelLayer txtlayer = new LabelLayer();
        myMap.Layers.Add(txtlayer);
        LabelSource source = new LabelSource(MapInfo.Engine.Session.Current.Catalog.GetTable("Animation"));
        source.DefaultLabelProperties.Caption = "显示";
        source.DefaultLabelProperties.Style = _textSymbol;
        txtlayer.Sources.Append(source);

posted @ 2006-06-06 15:20  不老仙翁  阅读(2590)  评论(5编辑  收藏  举报