Ejemplo n.º 1
0
        /// <summary>
        /// Handles open button click event.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void openBtn_Click(object sender, EventArgs e)
        {
            WMCDocument document = new WMCDocument();

            document.LoadFromFile(textBox1.Text);

            if (document.IsValidWMCDoc())
            {
                this.openBtn.Enabled = false;
                AddToMap(document);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds wmc document information to map
        /// </summary>
        /// <param name="theDoc">the WMCDocument object</param>
        private void AddToMap(WMCDocument theDoc)
        {
            IMxDocument ipMxDoc = (IMxDocument)m_pApp.Document;

            foreach (WMCLayer layer in theDoc.Layers)
            {
                AddTheLayer(layer, ipMxDoc);
            }

            // set spatial reference system / projection
            SetSpatialReference(ipMxDoc, theDoc.SRS);

            //do the layer visibility
            SetLayerVisibility(ipMxDoc);

            if (theDoc.HasExtent)
            {
                ipMxDoc.ActiveView.Extent = theDoc.Extent;
                ipMxDoc.ActiveView.Refresh();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handles open button click event.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void openBtn_Click(object sender, EventArgs e)
        {
            WMCDocument document = new WMCDocument();
            document.LoadFromFile(textBox1.Text);

            if (document.IsValidWMCDoc())
            {
                this.openBtn.Enabled = false;
                AddToMap(document);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Adds wmc document information to map
        /// </summary>
        /// <param name="theDoc">the WMCDocument object</param>
        private void AddToMap(WMCDocument theDoc)
        {
            IMxDocument ipMxDoc = (IMxDocument)m_pApp.Document;

            foreach (WMCLayer layer in theDoc.Layers)
            {
                AddTheLayer(layer, ipMxDoc);
            }

            // set spatial reference system / projection
            SetSpatialReference(ipMxDoc, theDoc.SRS);

            //do the layer visibility
            SetLayerVisibility(ipMxDoc);

            if (theDoc.HasExtent)
            {
                ipMxDoc.ActiveView.Extent = theDoc.Extent;
                ipMxDoc.ActiveView.Refresh();
            }
        }