Beispiel #1
0
        public void UpdateCenterTileXYLocation()
        {
            PointLatLng center = FromLocalToLatLng(Width / 2, Height / 2);

            GMap.NET.Point centerPixel = Projection.FromLatLngToPixel(center, Zoom);
            centerTileXYLocation = Projection.FromPixelToTileXY(centerPixel);
        }
Beispiel #2
0
        /// <summary>
        /// draw polygons, override to draw custom
        /// </summary>
        /// <param name="g"></param>
        protected virtual void DrawPolygons(Graphics g)
        {
#if !PocketPC
            foreach (GMapPolygon r in Polygons)
            {
                if (r.IsVisible)
                {
                    using (GraphicsPath rp = new GraphicsPath())
                    {
                        for (int i = 0; i < r.LocalPoints.Count; i++)
                        {
                            GMap.NET.Point p2 = r.LocalPoints[i];

                            if (i == 0)
                            {
                                rp.AddLine(p2.X, p2.Y, p2.X, p2.Y);
                            }
                            else
                            {
                                System.Drawing.PointF p = rp.GetLastPoint();
                                rp.AddLine(p.X, p.Y, p2.X, p2.Y);
                            }
                        }

                        if (rp.PointCount > 0)
                        {
                            rp.CloseFigure();

                            g.FillPath(r.Fill, rp);

                            g.DrawPath(r.Stroke, rp);
                        }
                    }
                }
            }
#else
            foreach (GMapPolygon r in Polygons)
            {
                if (r.IsVisible)
                {
                    Point[] pnts = new Point[r.LocalPoints.Count];
                    for (int i = 0; i < r.LocalPoints.Count; i++)
                    {
                        Point p2 = new Point(r.LocalPoints[i].X, r.LocalPoints[i].Y);
                        pnts[pnts.Length - 1 - i] = p2;
                    }

                    if (pnts.Length > 0)
                    {
                        g.FillPolygon(r.Fill, pnts);
                        g.DrawPolygon(r.Stroke, pnts);
                    }
                }
            }
#endif
        }
Beispiel #3
0
 public void SetMapPoints(int gridX, int gridY, GMap.NET.Point point)
 {
     _gridTracking[gridX, gridY].Add(point);
 }