예제 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            _mapPath = Application.StartupPath + "\\Map\\Weather.Mxd";
            axMapControl1.LoadMxFile(_mapPath);

            string[] provinces = new string[] { "全国", "黑龙江省", "内蒙古自治区", "新疆维吾尔自治区", "吉林省", "甘肃省", "河北省", "北京市", "山西省", "天津市", "陕西省", "宁夏回族自治区", "青海省", "辽宁省", "山东省", "西藏自治区", "河南省", "江苏省", "安徽省", "四川省", "湖北省", "重庆市", "上海市", "浙江省", "湖南省", "江西省", "云南省", "贵州省", "广西壮族自治区", "福建省", "台湾省", "海南省", "广东省", "香港特别行政区", "澳门" };

            ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
            foreach (string str in provinces)
            {
                comboBox1.Items.Add(str);
            }

            comboBox1.SelectedIndex = 0;

            QueryTool qryTool = new QueryTool();

            axToolbarControl1.AddItem(qryTool, -1, 0, false, -1, esriCommandStyles.esriCommandStyleIconOnly);
            qryTool.LabelEvent += new QueryTool.LabelEventHandler(qryTool_LabelEvent);

            RemoveLabesCmd delete = new RemoveLabesCmd();

            axToolbarControl1.AddItem(delete, -1, 0, false, -1, esriCommandStyles.esriCommandStyleIconOnly);
            delete.LabelEvent += new RemoveLabesCmd.LabelEventHandler(revLabels_RemoveLabelsEvent);

            ZoomtoProvince(provinces[0]);

            InitialWeather();

            AddField();

            cityTeme cityteme1 = getMaxTemp();
            cityTeme cityteme2 = getMinTemp();

            label3.Text = "明日气温最高的城市:" + cityteme1.City + "\n温度为:" + cityteme1.Teme + "℃";
            label4.Text = "明日气温最低的城市:" + cityteme2.City + "\n温度为:" + cityteme2.Teme + "℃";
        }
예제 #2
0
파일: Form1.cs 프로젝트: cwtok123/ArcEngine
        private void Form1_Load(object sender, EventArgs e)
        {
            _mapPath = Application.StartupPath + "\\Map\\Weather.Mxd";
            axMapControl1.LoadMxFile(_mapPath);

            string[] provinces = new string[] { "全国", "黑龙江省", "内蒙古自治区", "新疆维吾尔自治区", "吉林省", "甘肃省", "河北省", "北京市", "山西省", "天津市", "陕西省", "宁夏回族自治区", "青海省", "辽宁省", "山东省", "西藏自治区", "河南省", "江苏省", "安徽省", "四川省", "湖北省", "重庆市", "上海市", "浙江省", "湖南省", "江西省", "云南省", "贵州省", "广西壮族自治区", "福建省", "台湾省", "海南省", "广东省", "香港特别行政区", "澳门" };

            ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
            foreach (string str in provinces)
            {
                comboBox1.Items.Add(str);
            }

            comboBox1.SelectedIndex = 0;

            QueryTool qryTool = new QueryTool();
            axToolbarControl1.AddItem(qryTool, -1, 0, false, -1, esriCommandStyles.esriCommandStyleIconOnly);
            qryTool.LabelEvent += new QueryTool.LabelEventHandler(qryTool_LabelEvent);

            RemoveLabesCmd delete = new RemoveLabesCmd();
            axToolbarControl1.AddItem(delete, -1, 0, false, -1, esriCommandStyles.esriCommandStyleIconOnly);
            delete.LabelEvent += new RemoveLabesCmd.LabelEventHandler(revLabels_RemoveLabelsEvent);

            ZoomtoProvince(provinces[0]);

            InitialWeather();

            AddField();

            cityTeme cityteme1 = getMaxTemp();
            cityTeme cityteme2 = getMinTemp();
            label3.Text = "明日气温最高的城市:" + cityteme1.City + "\n温度为:" + cityteme1.Teme + "℃";
            label4.Text = "明日气温最低的城市:" + cityteme2.City + "\n温度为:" + cityteme2.Teme + "℃";
        }