/// <summary>
        /// 闪烁查询到要素
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void flashFeature(object sender, UploadStringCompletedEventArgs e)
        {
            geoObj = this.IMSCatalog.ActiveLayerObj.OnGetGeomByFID(e);
            if (geoObj == null)
            {
                return;
            }
            List <Point> pntArr = new List <Point>();

            for (int i = 0; i < geoObj.RegGeom[0].Rings.Length; i++)
            {
                for (int j = 0; j < geoObj.RegGeom[0].Rings[i].Arcs.Length; j++)
                {
                    for (int k = 0; k < geoObj.RegGeom[0].Rings[i].Arcs[j].Dots.Length; k++)
                    {
                        pntArr.Add(new Point(geoObj.RegGeom[0].Rings[i].Arcs[j].Dots[k].x, geoObj.RegGeom[0].Rings[i].Arcs[j].Dots[k].y));
                    }
                }
            }
            if (pntArr[0].X <this.IMSCatalog.ActiveLayerObj.MapContainer.WinViewBound.XMin || pntArr[0].X> this.IMSCatalog.ActiveLayerObj.MapContainer.WinViewBound.XMax ||
                pntArr[0].Y <this.IMSCatalog.ActiveLayerObj.MapContainer.WinViewBound.YMin || pntArr[0].Y> this.IMSCatalog.ActiveLayerObj.MapContainer.WinViewBound.YMax)
            {
                this.IMSCatalog.ActiveLayerObj.MapContainer.PanTo(pntArr[0].X, pntArr[0].Y);
            }
            m_graphics = new IMSPolygon(CoordinateType.Logic)
            {
                Points = pntArr
            };
            m_graphicsLayer.AddGraphics(m_graphics);
            m_graphics.FlickerOverCallback = new GraphicsFlickerOverDelegate(FlickerOverCallback);
            m_graphics.Draw();
            m_graphics.Flicker();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 闪烁图形
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FlashFeature(object sender, UploadStringCompletedEventArgs e)
        {
            try
            {
                m_featureGeo = activeMapDoc.OnGetGeomByID(e);
            }
            catch (Exception ex)
            {
                MessageBox.Show("获取该要素空间信息失败!" + ex.Message);
                return;
            }
            bool flg = false;

            if (m_featureGeo.LinGeom != null && m_featureGeo.LinGeom.Length > 0)
            {
                List <Point> pntArr = new List <Point>();
                for (int i = 0; i < m_featureGeo.LinGeom.Length; i++)
                {
                    for (int j = 0; j < m_featureGeo.LinGeom[i].Line.Arcs.Length; j++)
                    {
                        for (int k = 0; k < m_featureGeo.LinGeom[i].Line.Arcs[j].Dots.Length; k++)
                        {
                            pntArr.Add(new Point(m_featureGeo.LinGeom[i].Line.Arcs[j].Dots[k].x, m_featureGeo.LinGeom[i].Line.Arcs[j].Dots[k].y));
                        }
                    }
                }
                if (pntArr[0].X <activeMapDoc.MapContainer.WinViewBound.XMin || pntArr[0].X> activeMapDoc.MapContainer.WinViewBound.XMax ||
                    pntArr[0].Y <activeMapDoc.MapContainer.WinViewBound.YMin || pntArr[0].Y> activeMapDoc.MapContainer.WinViewBound.YMax)
                {
                    activeMapDoc.MapContainer.PanTo(pntArr[0].X, pntArr[0].Y);
                }
                m_graphics = new IMSPolyline(CoordinateType.Logic)
                {
                    Points          = pntArr,
                    StrokeThickness = 4
                };
                flg = true;
            }
            if (m_featureGeo.PntGeom != null && m_featureGeo.PntGeom.Length > 0)
            {
                if (m_featureGeo.PntGeom[0].Dot.x <activeMapDoc.MapContainer.WinViewBound.XMin || m_featureGeo.PntGeom[0].Dot.x> activeMapDoc.MapContainer.WinViewBound.XMax ||
                    m_featureGeo.PntGeom[0].Dot.y <activeMapDoc.MapContainer.WinViewBound.YMin || m_featureGeo.PntGeom[0].Dot.y> activeMapDoc.MapContainer.WinViewBound.YMax)
                {
                    activeMapDoc.MapContainer.PanTo(m_featureGeo.PntGeom[0].Dot.x, m_featureGeo.PntGeom[0].Dot.y);
                }
                m_graphics = new IMSCircle(CoordinateType.Logic)
                {
                    CenX     = m_featureGeo.PntGeom[0].Dot.x,
                    CenY     = m_featureGeo.PntGeom[0].Dot.y,
                    RadiusEx = 6
                };
                flg = true;
            }
            if (m_featureGeo.RegGeom != null && m_featureGeo.RegGeom.Length > 0)
            {
                List <Point> pntArr = new List <Point>();
                for (int i = 0; i < m_featureGeo.RegGeom[0].Rings.Length; i++)
                {
                    for (int j = 0; j < m_featureGeo.RegGeom[0].Rings[i].Arcs.Length; j++)
                    {
                        for (int k = 0; k < m_featureGeo.RegGeom[0].Rings[i].Arcs[j].Dots.Length; k++)
                        {
                            pntArr.Add(new Point(m_featureGeo.RegGeom[0].Rings[i].Arcs[j].Dots[k].x, m_featureGeo.RegGeom[0].Rings[i].Arcs[j].Dots[k].y));
                        }
                    }
                }
                if (pntArr[0].X <activeMapDoc.MapContainer.WinViewBound.XMin || pntArr[0].X> activeMapDoc.MapContainer.WinViewBound.XMax ||
                    pntArr[0].Y <activeMapDoc.MapContainer.WinViewBound.YMin || pntArr[0].Y> activeMapDoc.MapContainer.WinViewBound.YMax)
                {
                    activeMapDoc.MapContainer.PanTo(pntArr[0].X, pntArr[0].Y);
                }
                m_graphics = new IMSPolygon(CoordinateType.Logic)
                {
                    Points = pntArr
                };
                flg = true;
            }
            if (flg)
            {
                m_graphicsLayer.AddGraphics(m_graphics);
                m_graphics.FlickerOverCallback = new GraphicsFlickerOverDelegate(FlickerOverCallback);
                m_graphics.Draw();
                m_graphics.Flicker();
            }
        }