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

📄 mainwebform.aspx.cs

📁 supermap开发的基站管理系统
💻 CS
📖 第 1 页 / 共 5 页
字号:
            if (!isFirst)
                type += ",";
            isFirst = false;
            type += "C";
        }
        if (CheckBox5.Checked) //  30MHZ以下无线电台(站)-H 
        {
            if (!isFirst)
                type += ",";
            isFirst = false;
            type += "H";
        }
        if (CheckBox6.Checked) // 地面固定业务台(站)-TF
        {
            if (!isFirst)
                type += ",";
            isFirst = false;
            type += "TF";
        }
        if (CheckBox7.Checked) //   直放站-D
        {
            if (!isFirst)
                type += ",";
            isFirst = false;
            type += "D";
        }
        if (CheckBox8.Checked)  // 无线电台(站)-V
        {
            if (!isFirst)
                type += ",";
            isFirst = false;
            type += "V";
        }
        return type;
    }
    #endregion

    #region 鹰眼
    protected void mapControl2_Querying(object sender, SuperMap.IS.WebControls.EventArguments.QueryingEventArgs e)
    {
        if (e.ClientActionArgs == null || e.ClientActionArgs.MapCoords.Length == 0)
            return;
        MapControl1.CenterPoint = new MapCoord(e.ClientActionArgs.MapCoords[0].X, e.ClientActionArgs.MapCoords[0].Y);
        MapControl1.Update();
        e.Cancel = true;
      //  InitMap2();
        
    }

    private void InitMap2()
    {
        if (PostBackCount > 1)
        {
            mapControl2.ViewEntire();
            mapControl2.ClientAction = "POINTQUERY";
            mapControl2.ViewByBounds(GetTwoMapControlSumBounds());
            MapCoord[] coords =new MapCoord[5];
            mapControl2.CustomLayer.Clear();
            //// mapControl2.Update();
            coords[0] = MapControl1.ViewBounds.LeftBottom;
            coords[1] = new MapCoord(MapControl1.ViewBounds.LeftBottom.X, MapControl1.ViewBounds.RightTop.Y);
            coords[2] = new MapCoord(MapControl1.ViewBounds.RightTop.X - 0.1, MapControl1.ViewBounds.RightTop.Y);
            coords[3] = new MapCoord(MapControl1.ViewBounds.RightTop.X - 0.1, MapControl1.ViewBounds.LeftBottom.Y);
            coords[4] = MapControl1.ViewBounds.LeftBottom;
            mapControl2.CustomLayer.Lines.Add("poly", coords, "0.001", "Red");
            mapControl2.CustomLayer.Marks.Add("center", MapControl1.CenterPoint.X, MapControl1.CenterPoint.Y, "<img src='images/hotballold.gif'>");
            mapControl2.CustomLayer.Visible = true;
            mapControl2.Update();
        }
    }
    /// <summary>
    /// 得到地图和鹰眼的区域合集
    /// </summary>
    /// <returns></returns>
    private  MapRect  GetTwoMapControlSumBounds()
    {
        double minx = 0, miny = 0, maxx = 0, maxy = 0;
        minx = Math.Min(mapControl2.ViewBounds.LeftBottom.X, MapControl1.ViewBounds.LeftBottom.X);
        miny = Math.Min(mapControl2.ViewBounds.LeftBottom.Y, MapControl1.ViewBounds.LeftBottom.Y);
        maxx = Math.Max(mapControl2.ViewBounds.RightTop.X, MapControl1.ViewBounds.RightTop.X);
        maxy = Math.Max(mapControl2.ViewBounds.RightTop.Y, MapControl1.ViewBounds.RightTop.Y);
       
        return new MapRect(minx,miny,maxx,maxy);
       
    }
    #endregion

    #region ToolBar
    
    /// <summary>
    /// 清楚当前操作
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void img30_Click(object sender, ImageClickEventArgs e)
    {
        MapControl1.ClientAction = "";
    }
    /// <summary>
    /// 画链路 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ImgBtn13_Click(object sender, ImageClickEventArgs e)
    {
        DrawLL();
       
    }
    /// <summary>
    /// 画链路

    /// </summary>
    private void DrawLL()
    {
        string guidText = guid.Value;
        if (guidText == "")
            this.ShowDialog("请选择台站!");
        else
        {
            // this.ShowDialog(guidText );
            MapControl1.CustomLayer.Clear();
            addStatLink(guidText, "statInfo");

        }

    }
    //下一视图
    protected void img08_Click(object sender, ImageClickEventArgs e)
    {
        MapControl1.ViewNext();
      //  InitMap2();
    }
    //上一视图
    protected void img07_Click(object sender, ImageClickEventArgs e)
    {
        MapControl1.ViewPrevious();
     //   InitMap2();

    }
    protected void img27_Click(object sender, ImageClickEventArgs e)
    {
        ClearMap();
        guid.Value = "";
        CurTZList = null;
        this.CurLLMapCoordList = null;
        CurFWJList = null;
    }
    /// <summary>
    /// 清楚高亮
    /// </summary>
    private void ClearMap()
    {
        MapControl1.CustomLayer.Clear();
        MapControl1.ClearHighlight();
        this.QueryMapType = "";
        CurTZList = new ArrayList();
    }
    /// <summary>
    /// 自由放大
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void img02_Click(object sender, ImageClickEventArgs e)
    {
        this.MapControl1.Zoom(2);
    }
    /// <summary>
    /// 自由缩小
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void img03_Click(object sender, ImageClickEventArgs e)
    {
        this.MapControl1.Zoom(0.5);
    }
    #endregion

    #region 图层控制
    /// <summary>
    /// 保存图层的显示/隐藏序列(存储顺序是地图控件中的图层顺序一致)
    /// </summary>
    private DataTable    LayerConfigTalbe
    {
        set
        {
            Session["LayerConfigTalbe"] = value;
        }
        get
        {
            if (Session["LayerConfigTalbe"] == null)
                return StaticClass.CreateLayerTable();
            return (DataTable)Session["LayerConfigTalbe"];
        }
    }
    /// <summary>
    /// 当前图层显示/隐藏序列(存储顺序是地图控件中的图层顺序一致)
    /// </summary>
    private DataTable CurMapLayerConfigTable
    {
        set
        {
            Session["CurMapLayerConfigTable"] = value;
        }
        get
        {
            if (Session["CurMapLayerConfigTable"] == null)
                return StaticClass.CreateLayerTable();
            return (DataTable)Session["CurMapLayerConfigTable"];
        }
    }
    /// <summary>
    /// 根据当前图层显示/隐藏序列初始化地图

    /// </summary>
    private void InitMapControlByCurMapLayerConfigTable()
    {
        DataTable dt = this.CurMapLayerConfigTable;
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            MapControl1.Layers[i].Visible =Convert.ToBoolean( dt.Rows[i][0]);
        }
        MapControl1.Update();
    }
    /// <summary>
    /// 根据图层控件初始化当前图层显示/隐藏序列
    /// </summary>
    private void InitCurMapLayerConfigTableByGridViewLayer()
    {
        DataTable dt = this.CurMapLayerConfigTable;
        dt.Rows.Clear();
        for (int i = 0; i < GridViewLayer.Rows.Count ; i++)
        {
            CheckBox checkVisible = (CheckBox)GridViewLayer.Rows[i].FindControl("checkBoxLayer");
            dt.Rows.Add(checkVisible.Checked , GridViewLayer.Rows[i].Cells[1].Text);

        }
        this.CurMapLayerConfigTable = dt;
    }
    /// <summary>
    /// 根据当前图层显示/隐藏序列初始化图层的显示/隐藏序列
    /// </summary>
    private void InitLayerConfigTalbeByCurMapLayerConfigTable()
    {
       // this.LayerConfigTalbe = this.CurMapLayerConfigTable;

        DataTable dt1 = this.LayerConfigTalbe;
        DataTable dt = this.CurMapLayerConfigTable;
        dt1.Rows.Clear();
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt1.Rows.Add(dt.Rows[i].ItemArray);

        }
        this.LayerConfigTalbe = dt1;
    }
    /// <summary>
    /// 根据图层的显示/隐藏序列初始化当前地图和当前图层显示/隐藏序列
    /// </summary>
    private void InitMapControlAndCurMapLayerConfigTableByLayerConfigTalbe()
    {
      
        DataTable dt = this.LayerConfigTalbe;
        DataTable dt1 = this.CurMapLayerConfigTable;
        dt1.Rows.Clear();
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt1.Rows.Add(dt.Rows[i].ItemArray);

        }
        this.CurMapLayerConfigTable = dt1;
        InitMapControlByCurMapLayerConfigTable();
    }
    /// <summary>
    /// 根据当前地图中图层的显示/隐藏初始化图层控件中的显示列
    /// </summary>
    private void InitGridViewLayerInCheckByMapControl()
    {
        try
        {
            for (int i = 0; i < MapControl1.Layers.Length; i++)
            {
                CheckBox checkVisible = (CheckBox)GridViewLayer.Rows[i].FindControl("checkBoxLayer");
                checkVisible.Checked = MapControl1.Layers[i].Visible;
            }
        }
        catch(Exception e)
        {
        }
    }
    /// <summary>
    /// 根据地图控件初始化当前图层显示/隐藏序列和图层的显示/隐藏序列以及图层控件(网页初始化时被使用,主要是初始化变量);
    /// </summary>
    private void InitLayerConfigAndGridViewLayerByMapCongtrol()
    {
        try
        {
            if (PostBackCount==2)
            {
                DataTable dt = this.CurMapLayerConfigTable;
                DataTable dt1 = this.LayerConfigTalbe;
                dt.Rows.Clear();
                dt1.Rows.Clear();
                for (int i = 0; i < MapControl1.Layers.Length; i++)
                {
                    dt.Rows.Add(MapControl1.Layers[i].Visible, StaticClass.DealString(MapControl1.Layers[i].Name));
                    dt1.Rows.Add(MapControl1.Layers[i].Visible, StaticClass.DealString(MapControl1.Layers[i].Name));
                }
              //  if(!IsPostBack)
                this.CurMapLayerConfigTable = dt;
                this.LayerConfigTalbe = dt1;
                InitGridViewLayerByLayerConfigTalbe();
                this.InitGridViewLayerInCheckByMapControl();
            }
            else if (PostBackCount > 2)
            {
                this.InitGridViewLayerInCheckByMapControl();
            }
           // InitGridViewLayerByLayerConfigTalbe();
        }
        catch(Exception e)
        {
        }
       
    }
    private void InitGridViewLayerByLayerConfigTalbe()
    {
        GridViewLayer.DataSource = this.CurMapLayerConfigTable ;
        this.DataBind();
    }
    /// <summary>
    /// 图层控制提交
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void IBtnLayer_Click(object sender, ImageClickEventArgs e)
    {
       // this.InitLayerConfigAndGridViewLayerByMapCongtrol();
        this.InitCurMapLayerConfigTableByGridViewLayer();
        this.InitLayerConfigTalbeByCurMapLayerConfigTable();
        this.InitMapControlByCurMapLayerConfigTable();
    }
    /// <summary>
    /// 图层控制重置
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void IBtnBack_Click(object sender, ImageClickEventArgs e)
    {
        this.InitMapControlAndCurMapLayerConfigTableByLayerConfigTalbe();
        this.InitGridViewLayerInCheckByMapControl();
    }
  
    /// <summary>
    ///  初始化图层配置

    /// </summary>
    private void InitLayerConfig()
    {
       

⌨️ 快捷键说明

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