Exemplo n.º 1
0
        public frmAreaChart(IMFToolBox _toolBox)
        {
            InitializeComponent();
            this.LookAndFeel.SkinName = AppConfigFacade.DefaultTheme;
            Icon icon = global::GlobleSituation.Properties.Resources.App;

            this.Icon = icon;

            toolBox = _toolBox;

            SetChartVisible(false);
            btnExpand.Text = ">>";

            Init();
        }
Exemplo n.º 2
0
        public GMapControlBusiness mapBusiness = null;                         // 业务类


        public GMapControlEx(TrackLineManager trackMgr, ArcGlobeBusiness _globeBusiness)
        {
            InitializeComponent();

            InitMapFrame mapFrame = new InitMapFrame(MapEngineType.GMap, null);

            mapLogic = mapFrame.GetMapLogic();
            toolBox  = mapLogic.GetToolBox();
            map      = mapLogic.GetIMFMap();
            map.ElementClickEvent += Map_ElementClickEvent;
            map.MouseMoveEvent    += new EventHandler <MFMouseEventArgs>(map_MouseMoveEvent);

            Control mapControl = (Control)mapLogic.GetMapControl();

            mapControl.Dock = DockStyle.Fill;
            this.mapPanel.Controls.Add(mapControl);

            mapBusiness = new GMapControlBusiness(mapLogic, trackMgr, _globeBusiness);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 跳转到某目标
        /// </summary>
        /// <param name="name"></param>
        public void JumpToPlane(byte type, string elementName)
        {
            if (mapLogic == null)
            {
                return;
            }
            IMFLayer layer = mapLogic.GetLayer(GetModelLayerName(type));

            if (layer == null)
            {
                return;
            }

            IMFElement element = layer.GetElement(elementName);

            if (element == null)
            {
                return;
            }

            IMFPicture model = element as IMFPicture;

            if (model == null)
            {
                return;
            }

            MapLngLat  position = model.GetLngLat();;
            IMFToolBox toolBox  = mapLogic.GetToolBox();

            if (toolBox == null)
            {
                return;
            }

            toolBox.ZoomToPosition(position);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 创建地图地图工具箱
        /// </summary>
        /// <param name="mapObject">地图控件对象</param>
        /// <returns></returns>
        private IMFToolBox CreateToolBox(object mapObject)
        {
            IMFToolBox _toolBox = null;

            #region 反射
            object      RetObj = null;
            object[]    obj    = new object[] { mapObject, this };
            LibraryInfo info   = GetLibraryInfoByName("MapTool", mapEngineType.ToString());
            if (info == null)
            {
                return(null);
            }

            try
            {
                Assembly asm = Assembly.Load(info.LibraryName);
                Type[]   tp  = asm.GetTypes();
                RetObj = (object)asm.CreateInstance(info.NameSpaceClass, true, BindingFlags.CreateInstance | BindingFlags.Instance | BindingFlags.Public | BindingFlags.IgnoreCase
                                                    , null, obj, CultureInfo.CurrentCulture, null);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(string.Format("通过反射创建IToolBox对象异常:{0}", ex.Message));
                return(null);
            }
            if (null == RetObj)
            {
                Debug.WriteLine("通过反射创建IToolBox对象失败!");
                return(null);
            }

            _toolBox = RetObj as IMFToolBox;
            #endregion

            return(_toolBox);
        }
Exemplo n.º 5
0
 /// <summary>
 /// 加载地图引擎
 /// </summary>
 /// <param name="mapObject">地图控件对象</param>
 private void LoadMapEngine(object mapObject)
 {
     mapFactory = CreateFactory(mapObject);
     toolBox    = CreateToolBox(mapFactory.GetMapControl());
 }