Example #1
0
        private void recordsetToTrackingLayer(soRecordset objRd)
        {
            soStyle style = new soStyle();
            style.PenColor = Util.ColorToUInt32(Color.Red);
            //style.BrushStyle = 0;
            style.BrushOpaqueRate = 50;

            objRd.MoveFirst();
            while (!objRd.IsEOF())
            {
                soGeometry geo = objRd.GetGeometry();
                this.axSuperMap1.TrackingLayer.AddEvent(geo, style, "Search");
                objRd.MoveNext();
            }
        }
Example #2
0
        /// <summary>
        /// 设置地图的显示范围
        /// </summary>
        /// <param name="objRd">需要显示的记录集</param>
        private void viewRecordset(soRecordset objRd)
        {
            double left = Double.MaxValue;
            double right = Double.MinValue;
            double bottom = Double.MaxValue;
            double top = Double.MinValue;
            objRd.MoveFirst();
            while (!objRd.IsEOF())
            {
                soRect bounds = objRd.GetGeometry().Bounds;
                if (left>bounds.Left)
                {
                    left = bounds.Left;
                }
                if (right < bounds.Right)
                {
                    right = bounds.Right;
                }
                if (bottom > bounds.Bottom)
                {
                    bottom = bounds.Bottom;
                }
                if (top < bounds.Top)
                {
                    top = bounds.Top;
                }
                objRd.MoveNext();
            }

            soRect rect = new soRect();
            rect.Left = left;
            rect.Right = right;
            rect.Bottom = bottom;
            rect.Top = top;

            viewBounds(rect);
        }