Exemplo n.º 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;
                }
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }