Beispiel #1
0
        public static void InitializeWorkbench()
        {
            workbench = new DefaultWorkbench();
            MessageService.MainForm = workbench;

            caller = new STAThreadCaller(workbench);

            workbench.InitializeWorkspace();

            workbench.WorkbenchLayout = new SdiWorkbenchLayout();

            //display mapview
            IViewContent browserPane = new MapViewPane();
            browserPane.TitleName = "view1";
            if (browserPane != null)
            {
                WorkbenchSingleton.Workbench.ShowView(browserPane);
            }
            //link layertree and mapview
            foreach (PadDescriptor item in workbench.PadContentCollection)
            {
                LayerTree tree = item.PadContent as LayerTree;
                if (tree != null)
                {
                    DotSpatial.Controls.Legend legend = tree.Control as DotSpatial.Controls.Legend;
                    
                    ((browserPane as MapViewPane).Control as MapView).MapControl.Legend = legend;
                    break;
                }
            }
        }
Beispiel #2
0
        static IViewContent GetMapView()
        {
            IViewContent browserPane = null;
            if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null)
            {
                browserPane = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent as MapViewPane;
            }
            if (browserPane == null)
            {
                browserPane = new MapViewPane();
                browserPane.TitleName = "view1";
            }

            return browserPane;
        }
Beispiel #3
0
        public IViewContent CreateContentForFile(string fileName)
        {
            //载入地图
            MapViewPane browserPane = null;
            if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null)
            {
                browserPane = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent as MapViewPane;
            }
            if (browserPane == null)
            {
                browserPane = new MapViewPane();
            }
            browserPane.Load(fileName);

            return browserPane;
        }
Beispiel #4
0
        public IViewContent CreateContentForFile(string fileName)
        {
            //载入地图
            MapViewPane browserPane = null;

            if (WorkbenchSingleton.Workbench.ActiveWorkbenchWindow != null)
            {
                browserPane = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow.ViewContent as MapViewPane;
            }
            if (browserPane == null)
            {
                browserPane = new MapViewPane();
            }
            browserPane.Load(fileName);

            return(browserPane);
        }