Ejemplo n.º 1
0
        void mainMap_MouseClick(object sender, MouseEventArgs e)
        {
            PointLatLng pnew = mainMap.FromLocalToLatLng(e.X, e.Y);

            if (e.Button == MouseButtons.Left)
            {
                moveCurrentMarker(pnew);
            }
            if (isPolygonFuncClicked)
            {
                if (e.Button == MouseButtons.Left)
                {
                    var polygonManager = new ObjectsManager.PolygonManager();
                    _pointsPoly.Add(mainMap.FromLocalToLatLng(e.X, e.Y));
                    polygonManager.Preview(_pointsPoly);
                }
            }
        }
Ejemplo n.º 2
0
 private void mainMap_OnPolygonClick(GMapPolygon item, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         item.Stroke = new Pen(Color.Yellow, 3);
         var polygonManager = new ObjectsManager.PolygonManager();
         var polygonCollectionManagerWrap = Activator.CreateInstance(null, "AADS.ObjectsManager.PolygonCollectionManager");
         var polygonCollectionManager     = (ObjectsManager.PolygonCollectionManager)polygonCollectionManagerWrap.Unwrap();
         var controlSet = new Views.ShowCategory.Polygon();
         panelRightShow.Controls.Clear();
         panelRightShow.Controls.Add(controlSet);
         Debug.WriteLine("Click on Polygon ID " + (string)polygonCollectionManager.FindId(item));
         if ((string)polygonCollectionManager.FindId(item).Substring(0, 2) == "ra")
         {
             this.isRaClicked = true;
             controlSet.SetControl(ControlViews.RestrictedAreaCreation);
             SetPolygonFuncClick(false);
         }
         else if ((string)polygonCollectionManager.FindId(item).Substring(0, 2) == "rd")
         {
             this.isRdClicked = true;
             controlSet.SetControl(ControlViews.ResourceCreation);
             SetPolygonFuncClick(false);
         }
         else if ((string)polygonCollectionManager.FindId(item).Substring(0, 2) == "geo")
         {
             this.isGeoClicked = true;
             controlSet.SetControl(ControlViews.GeographicCreation);
             SetPolygonFuncClick(false);
         }
         //if (isRdClicked)
         //{
         //    var rdCreation = Views.Polygon.ResourceCreation.GetInstance();
         //    rdCreation.SetPolygon(item);
         //    SetPolygonFuncClick(false);
         //}
         polygonManager.View(item);
     }
 }