Example #1
0
        private void mapControlEvents_OnExtentUpdated(object displayTransformation, bool sizeChanged, object newEnvelope)
        {
            EagleEyePad pad = UCService.GetContent(typeof(EagleEyePad)) as EagleEyePad;

            if (pad == null)
            {
                return;
            }
            IEnvelope pEnvelope = (IEnvelope)newEnvelope;

            pad.DrawEnvelope(pEnvelope);
            DF2DApplication app = DF2DApplication.Application;

            if (app == null || app.Workbench == null)
            {
                return;
            }
            app.Workbench.UpdateMenu();
        }
Example #2
0
        public override void Run(object sender, System.EventArgs e)
        {
            Map2DView mapView = (Map2DView)UCService.GetContent(typeof(Map2DView));
            bool      bBind   = mapView.Bind(this);

            if (!bBind)
            {
                return;
            }

            DF2DApplication app = (DF2DApplication)this.Hook;

            if (app == null || app.Current2DMapControl == null)
            {
                return;
            }
            try
            {
                Layer2DTreePad wsPad = (Layer2DTreePad)UCService.GetContent(typeof(Layer2DTreePad));
                EagleEyePad    epad  = UCService.GetContent(typeof(EagleEyePad)) as EagleEyePad;
                if (wsPad == null || epad == null)
                {
                    return;
                }
                app.Workbench.SetStatusInfo("二维数据加载中…");
                SplashScreenManager.Default.SendCommand(null, "开始加载二维数据......");

                if (wsPad != null && epad != null)
                {
                    DataUtils2D.AddAndVisualizeTreelistPipe(wsPad.TreeList, app.Current2DMapControl);       //加载管线图层
                    DataUtils2D.AddAndVisualizeTreelistBackground(wsPad.TreeList, app.Current2DMapControl); //加载背景图及辅助图层,为鹰眼加载影像图
                    DataUtils2D.AddAndVisualizeEgleEyeControlBackground(epad.MapControl);
                }
                app.Workbench.SetStatusInfo("就绪");
                LoggingService.Info("二维数据加载成功!");
            }
            catch (Exception ex)
            {
                app.Workbench.SetStatusInfo("二维数据加载错误");
                LoggingService.Error(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Example #3
0
        private void mapEvent_OnMapReplaced(object newMap)
        {
            this.axMapControl.ShowScrollbars = false;
            EagleEyePad pad = UCService.GetContent(typeof(EagleEyePad)) as EagleEyePad;

            if (pad == null)
            {
                return;
            }
            pad.MapControl.Map.ClearLayers();
            if (this.axMapControl.LayerCount > 0)
            {
                pad.MapControl.Map = new MapClass();
                for (int i = 0; i < this.axMapControl.LayerCount; i++)
                {
                    ILayer layer = this.axMapControl.Map.get_Layer(i);
                    RecursiveLayer(layer, pad.MapControl, Config.GetConfigValue("EagleEyeLayerName"));
                }
            }
        }