Ejemplo n.º 1
0
        /// <summary>
        /// 画注记
        /// </summary>
        /// <param name="g"></param>
        /// <param name="bounds"></param>
        /// <param name="centerPos"></param>
        /// <param name="scale"></param>
        /// <param name="fid2Text"></param>
        internal override void DrawLabel(Graphics g, Rectangle bounds, PointF centerPos, double scale, Dictionary <int, string> fid2Text, TextSymbol textSymbol)
        {
            MyPoint xyCenter = ETCProjection.LngLat2XY(new MyPoint(centerPos.X, centerPos.Y));
            double  xmin     = xyCenter.X - scale * bounds.Width / 2;
            double  xmax     = xyCenter.X + scale * bounds.Width / 2;
            double  ymin     = xyCenter.Y - scale * bounds.Height / 2;
            double  ymax     = xyCenter.Y + scale * bounds.Height / 2;

            for (int i = 0; i < myPoints.Count; i++)
            {
                string  text         = fid2Text[myPoints[i].FID];
                MyPoint xyProjection = ETCProjection.LngLat2XY(myPoints[i]);
                double  xScreen      = bounds.Width * (xyProjection.X - xmin) / (xmax - xmin);
                double  yScreen      = bounds.Height * (xyProjection.Y - ymin) / (ymax - ymin);
                TextSymbol.PointLabel(new PointF((float)xScreen, bounds.Height - (float)yScreen), g, textSymbol, text);  //此处注记样式不能修改。待完善
            }
        }