コード例 #1
0
 public DrawPolyline(PointLatLng p1, PointLatLng p2, int zoom, TOOL_TYPE type)
     : base()
 {
     property = new PropertyLine();
     property.LocalPosition = p1;
     property.DefaultZoom   = zoom;
     property.Type          = type;
     Overlay = Global.control.Overlays.Count - 1;
     PointsArray.Add(p1);
     PointsArray.Add(p2);
 }
コード例 #2
0
        public DrawPolygon(int x, int y, int zoom, TOOL_TYPE type)
            : base()
        {
            property               = new PropertyPolygon();
            property.DefaultZoom   = zoom;
            property.LocalPosition = Global.control.FromLocalToLatLng(x, y);
            property.Type          = type;
            Overlay = Global.control.Overlays.Count - 1;

            PointsArray.Add(Global.control.FromLocalToLatLng(x, y));
            PointsArray.Add(Global.control.FromLocalToLatLng(x + 30, y));
            PointsArray.Add(Global.control.FromLocalToLatLng(x + 30, y + 30));
            PointsArray.Add(Global.control.FromLocalToLatLng(x, y + 30));
        }
コード例 #3
0
        /*
         * public override void ClearLinkSelected()
         * {
         *  List<string> listRemove = new List<string>();
         *  foreach (KeyValuePair<string, LinkObject> o in mapLink)
         *  {
         *      if (o.Value.type == ACTION_TYPE.selected)
         *      {
         *          Global.control.Overlays[Overlay].Routes.Remove(o.Value.route);
         *          o.Value.marker.Clear();
         *          listRemove.Add(o.Key);
         *      }
         *  }
         *  foreach (string o in listRemove)
         *  {
         *      mapLink.Remove(o);
         *  }
         * }
         */

        public override void AddPoint(Point point)
        {
            if (route == null)
            {
                return;
            }
            PointLatLng p = Global.control.FromLocalToLatLng((int)point.X, (int)point.Y);

            PointsArray.Add(p);
            route.Points.Add(p);
            Global.control.UpdateRouteLocalPosition(route);
            property.Distance = route.Distance;
            Global.control.ObjectSelected(property);
        }
コード例 #4
0
        public DrawPolyline(int x, int y, int zoom, TOOL_TYPE type)
            : base()
        {
            property = new PropertyLine();
            property.LocalPosition = Global.control.FromLocalToLatLng(x, y);
            property.DefaultZoom   = zoom;
            property.Type          = type;

            Overlay = Global.control.Overlays.Count - 1;

            PointLatLng p;

            p = Global.control.FromLocalToLatLng(x, y);
            PointsArray.Add(p);
            p = Global.control.FromLocalToLatLng(x + 15, y + 15);
            PointsArray.Add(p);
        }
コード例 #5
0
ファイル: DrawEllipse.cs プロジェクト: cyberslacking/Fork
        public DrawEllipse(int x, int y,int zoom, TOOL_TYPE type)
            : base()
        {
            property = new PropertyPolygon();
            property.LocalPosition = Global.control.FromLocalToLatLng(x, y);
            property.DefaultZoom = zoom;
            property.Type = type;

            Overlay = Global.control.Overlays.Count - 1;

            Rectangle rect = new Rectangle(x, y, 40, 40);

            PointsArray.Add(Global.control.FromLocalToLatLng(x, y));
            PointsArray.Add(Global.control.FromLocalToLatLng(x + rect.Width, y));
            PointsArray.Add(Global.control.FromLocalToLatLng(x + rect.Width, y + rect.Height));
            PointsArray.Add(Global.control.FromLocalToLatLng(x, y + rect.Height));

            SetRectangle(rect);
        }
コード例 #6
0
ファイル: DrawImage.cs プロジェクト: cyberslacking/Fork
        public DrawImage(int x, int y, int zoom, TOOL_TYPE type)
            : base()
        {
            property               = new PropertyImage();
            property.DefaultZoom   = zoom;
            property.Type          = type;
            property.LocalPosition = Global.control.FromLocalToLatLng(x, y);

            Overlay = Global.control.Overlays.Count - 1;

            Bitmap    bmp  = new Bitmap(property.ImageFile);
            Rectangle rect = new Rectangle(x, y, (int)bmp.Width * 3 / 4, (int)bmp.Height * 3 / 4);

            PointsArray.Add(Global.control.FromLocalToLatLng(x, y));
            PointsArray.Add(Global.control.FromLocalToLatLng(x + rect.Width, y));
            PointsArray.Add(Global.control.FromLocalToLatLng(x + rect.Width, y + rect.Height));
            PointsArray.Add(Global.control.FromLocalToLatLng(x, y + rect.Height));

            SetRectangle(rect);
        }
コード例 #7
0
ファイル: DrawMarker.cs プロジェクト: cyberslacking/Fork
        public DrawMarker(long pid, int x, int y, int zoom, TOOL_TYPE type, MARKER_TYPE markerType)
            : base()
        {
            PointLatLng latlng = Global.control.FromLocalToLatLng(x, y);

            PointsArray.Add(latlng);

            property               = new PropertyMarker();
            property.DefaultZoom   = zoom;
            property.LocalPosition = latlng;
            property.Type          = type;
            property.MarkerType    = markerType;
            if (type == TOOL_TYPE.camera)
            {
                property.ImageFile = @"image\camera_0.ico";
            }
            else if (type == TOOL_TYPE.model)
            {
                property.ImageFile = @"image\model.ico";
            }
            else if (type == TOOL_TYPE.marker)
            {
                if (markerType == MARKER_TYPE.Green)
                {
                    property.ImageFile = @"image\marker_0.ico";
                }
                else if (markerType == MARKER_TYPE.Yellow)
                {
                    property.ImageFile = @"image\marker_2.ico";
                }
                else if (markerType == MARKER_TYPE.Red)
                {
                    property.ImageFile = @"image\marker_1.ico";
                }
                else if (markerType == MARKER_TYPE.Gray)
                {
                    property.ImageFile = @"image\marker_3.ico";
                }
            }
        }
コード例 #8
0
ファイル: DrawText.cs プロジェクト: cyberslacking/Fork
        public DrawText(int x, int y, int zoom, TOOL_TYPE type)
            : base()
        {
            property               = new PropertyText();
            property.DefaultZoom   = zoom;
            property.LocalPosition = Global.control.FromLocalToLatLng(x, y);
            property.Type          = type;

            Overlay = Global.control.Overlays.Count - 1;

            Graphics g    = Graphics.FromImage(new Bitmap(1, 1));
            SizeF    size = g.MeasureString(property.Name, property.Font);

            rectangle = new Rectangle(x, y, (int)(size.Width * 1.5), (int)size.Height);

            PointsArray.Add(Global.control.FromLocalToLatLng(x, y));
            PointsArray.Add(Global.control.FromLocalToLatLng(x + rectangle.Width, y));
            PointsArray.Add(Global.control.FromLocalToLatLng(x + rectangle.Width, y + rectangle.Height));
            PointsArray.Add(Global.control.FromLocalToLatLng(x, y + rectangle.Height));

            //SetRectangle(rectangle);
        }
コード例 #9
0
ファイル: DrawObject.cs プロジェクト: cyberslacking/Fork
        /// <summary>
        /// Load object from serialization stream
        /// </summary>
        /// <param name="info"></param>
        /// <param name="orderNumber"></param>
        public virtual void LoadFromStream(SerializationInfo info, int orderNumber)
        {
            GetProperty().ID = info.GetInt64(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryID, orderNumber));
            GetProperty().Name = info.GetString(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryName, orderNumber));
            overlay = info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryOverlay, orderNumber));
            GetProperty().Type = (TOOL_TYPE)info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryType, orderNumber));
            GetProperty().MaxZoom = info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryMaxZoom, orderNumber));
            GetProperty().MinZoom = info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryMinZoom, orderNumber));
            GetProperty().DefaultZoom = info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryDefaultZoom, orderNumber));

            GetProperty().LocalPosition = (PointLatLng)info.GetValue(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryLocalPosition, orderNumber),
                typeof(PointLatLng));

            PointsArray.Clear();
            PointLatLng point;
            int         n = info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryLengthPoint, orderNumber));

            for (int i = 0; i < n; i++)
            {
                point = (PointLatLng)info.GetValue(
                    String.Format(CultureInfo.InvariantCulture,
                                  "{0}{1}-{2}",
                                  entryPoint, orderNumber, i),
                    typeof(PointLatLng));

                PointsArray.Add(point);
            }

            n = info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}",
                              entryLengthLink, orderNumber));
            linkArray.Clear();
            for (int i = 0; i < n; i++)
            {
                Object link = (Object)info.GetValue(
                    String.Format(CultureInfo.InvariantCulture,
                                  "{0}{1}-{2}",
                                  entryLink, orderNumber, i),
                    typeof(Object));
                linkArray.Add(link);
            }
        }