예제 #1
0
 public override void Clear()
 {
     if (marker != null)
     {
         foreach (GMapOverlay overlay in Global.control.Overlays)
         {
             if (overlay.Markers.Contains(marker))
             {
                 overlay.Markers.Remove(marker);
                 marker = null;
                 break;
             }
         }
         marker = null;
     }
 }
예제 #2
0
        public void CreateMarker(object obj, Bitmap bmp, string text = "")
        {
            DestroyMarker(obj);

            var listPoint = new List <PointLatLng>();

            GetPositions(obj, ref listPoint);
            if (listPoint.Count > 0)
            {
                GMarkerImage marker = new GMarkerImage(listPoint[0]);
                marker.ToolTipText = String.Format("{0} Position:{1},{2}", text, Math.Round(listPoint[0].Lat, 8), Math.Round(listPoint[0].Lng, 8));
                marker.Bmp         = bmp;
                Global.control.Overlays[Overlay].Markers.Add(marker);
                mapMarker.Add(obj, marker);
                Global.control.Position = listPoint[0];
                Global.control.Zoom     = property.DefaultZoom;
            }
        }
예제 #3
0
 public override void Show()
 {
     if (marker == null)
     {
         base.Show();
         Rectangle rectangle = Rectangle.Round(GetRectangle());
         SetRectangle(rectangle);
         int         xCenter = rectangle.X + rectangle.Width / 2;
         int         yCenter = rectangle.Y + rectangle.Height / 2;
         PointLatLng postion = Global.control.FromLocalToLatLng(xCenter, yCenter);
         marker = new GMarkerImage(postion);
         marker.Adapter(PointsArray[0], PointsArray[2]);
         marker.Bmp = new Bitmap(property.ImageFile);
         marker.IsHitTestVisible = true;
         Global.control.Overlays[Overlay].Markers.Add(marker);
         property.ehLableValueChanged += new EHLableValueChanged(OnLableValueChanged);
         property.IsLoad = true;
         IsZoomVisible((int)Global.control.Zoom);
     }
 }