⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mapform.aspx.cs

📁 c#中用MapXtreme开发的地理信息系统
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MapInfo.WebControls;
using ApplicationStateManager;

public partial class _Default : System.Web.UI.Page 
{
    private void Page_Load(object sender, System.EventArgs e)
    {
        // If the StateManager doesn't exist in the session put it else get it.
        if (Session.IsNewSession)
        {
            MapInfo.WebControls.MapControlModel controlModel = MapControlModel.SetDefaultModelInSession();
            controlModel.Commands.Add(new Info());
            controlModel.Commands.Add(new getImage());
            controlModel.Commands.Add(new getThemeImage());
            controlModel.Commands.Add(new GetLegend());
        }
        this.MapControl1.Width = 775;
        this.MapControl1.Height = 500;
        if (StateManager.GetStateManagerFromSession() == null)
            StateManager.PutStateManagerInSession(new AppStateManager());

        // Now Restore State
        StateManager.GetStateManagerFromSession().ParamsDictionary[StateManager.ActiveMapAliasKey] = MapControl1.MapAlias;
        StateManager.GetStateManagerFromSession().RestoreState();
    }

    // At the time of unloading the page, save the state
    private void Page_UnLoad(object sender, System.EventArgs e)
    {
        StateManager.GetStateManagerFromSession().SaveState();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -