예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            List <IFeature> pFeatureList    = new List <IFeature>();
            List <IFeature> pCurFeatureList = EngineFuntions.GetSeartchFeatures(EngineFuntions.m_Layer_BusStation, "OBJECTID > -1");

            foreach (IFeature pfeature in pCurFeatureList)
            {
                IFeatureLayer CurFeatureLayer = EngineFuntions.SetCanSelLay("道路中心线");
                EngineFuntions.ClickSel(pfeature.ShapeCopy, false, true, 26);

                if (EngineFuntions.GetSeledFeatures(CurFeatureLayer, ref pFeatureList))
                {
                    foreach (IFeature pfea in pFeatureList)
                    {
                        int nIndex = pfeature.Fields.FindField("StationCharacter");
                        pfeature.set_Value(nIndex, pfea.get_Value(pfea.Fields.FindField("道路名称")) as string);
                    }
                }
                pfeature.Store();
            }
            MessageBox.Show("xxxxxx\n", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
예제 #2
0
        private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
        {
            m_mapPoint = axMapControl1.ToMapPoint(e.x, e.y);
            IActiveView pActiveView = axMapControl1.ActiveView;

            if (e.button == 1)
            {
                switch (m_ToolStatus)
                {
                case ForAR.Map3D_Select:
                    if (axMapControl1.Visible == true)
                    {
                        IGeometry pGeo;
                        pGeo = axMapControl1.TrackRectangle();
                        if (pGeo.Envelope.Height * pGeo.Envelope.Width == 0)
                        {
                            return;
                        }
                        List <IFeature> pSelFea = EngineFuntions.GetSeartchFeatures(EngineFuntions.m_Layer_BusStation, pGeo);
                        if (pSelFea.Count > 0)
                        {
                            frmAttribute frmPopup = new frmAttribute();
                            frmPopup.m_featureCollection = pSelFea;
                            frmPopup.ShowDialog();
                        }
                    }
                    break;

                case ForAR.Map3D_PointSelect:
                    if (axMapControl1.Visible == true)
                    {
                        m_CurFeatureLayer = EngineFuntions.SetCanSelLay("工程项目");
                        EngineFuntions.ClickSel(m_mapPoint, false, false, 6);
                        if (EngineFuntions.GetSeledFeatures(m_CurFeatureLayer, ref m_featureCollection))
                        {
                            frmAttribute frmPopup = new frmAttribute();
                            frmPopup.m_featureCollection = m_featureCollection;
                            frmPopup.ShowDialog();
                        }
                    }
                    break;

                case ForAR.Map3D_PolySelect:
                    if (axMapControl1.Visible == true)
                    {
                        IGeometry pGeo;
                        pGeo = axMapControl1.TrackPolygon();
                        if (pGeo.Envelope.Height * pGeo.Envelope.Width == 0)
                        {
                            return;
                        }
                        List <IFeature> pSelFea = EngineFuntions.GetSeartchFeatures(EngineFuntions.m_Layer_BusStation, pGeo);
                        if (pSelFea.Count > 0)
                        {
                            frmAttribute frmPopup = new frmAttribute();
                            frmPopup.m_featureCollection = pSelFea;
                            frmPopup.ShowDialog();
                        }
                    }
                    break;

                case ForAR.Map3D_CircleSelect:
                    if (axMapControl1.Visible == true)
                    {
                        IGeometry pGeo;
                        pGeo = axMapControl1.TrackCircle();
                        if (pGeo.Envelope.Height * pGeo.Envelope.Width == 0)
                        {
                            return;
                        }
                        List <IFeature> pSelFea = EngineFuntions.GetSeartchFeatures(EngineFuntions.m_Layer_BusStation, pGeo);
                        if (pSelFea.Count > 0)
                        {
                            frmAttribute frmPopup = new frmAttribute();
                            frmPopup.m_featureCollection = pSelFea;
                            frmPopup.ShowDialog();
                        }
                    }
                    break;

                default:
                    break;
                }
            }
            if (2 == e.button)
            {
                EngineFuntions.ZoomPoint(m_mapPoint, EngineFuntions.m_AxMapControl.Map.MapScale);
            }
        }