예제 #1
0
        private void OpenMap()
        {
            if (m_MapDocument != null && m_MapDocument != "")
            {
                // Check if a scenario is opened

                // If not, create one
                if (stkRoot.CurrentScenario == null)
                {
                    setStatus("创建新场景...");
                    stkRoot.NewScenario("Scenario1");
                    setStatus("");
                }

                m_TreeViewSTKScenario.InitializeTreeView();

                AGI.STKesriDisplay.AgEsri3dRendererFactory factory
                           = new AGI.STKesriDisplay.AgEsri3dRendererFactory();
                m_Renderer = factory.GetRenderer(1);

                this.m_Options.ApplyTo(m_Renderer);
                if (m_Renderer.MapDocument != null)
                {
                    m_Renderer.CloseMapDocument(AgESTKesriCallOptions.eEsri3dBlocking);
                }

                m_Renderer.OpenMapDocument(m_MapDocument, "");

                m_Renderer.OnDrawProgress      += m_OnDrawProgressEventHandler;
                m_Renderer.OnDrawEnd           += m_OnDrawEndEventHandler;
                m_Renderer.OnMapDocumentOpened += m_OnMapDocumentOpenedEventHandler;
                m_Renderer.OnMapDocumentClosed += m_OnMapDocumentClosedEventHandler;
            }
        }
예제 #2
0
 private void UnloadMap()
 {
     if (m_Renderer != null)
     {
         m_Renderer.CloseMapDocument(AgESTKesriCallOptions.eEsri3dBlocking);
         m_Renderer = null;
     }
 }