예제 #1
0
        private void m_menuDeletePoint_Click(object sender, EventArgs e)
        {
            CMoveablePoint movePoint = m_currentSelectedMapItem != null ? m_currentSelectedMapItem.Tag as CMoveablePoint: null;

            if (movePoint != null && movePoint.IsDeletable)
            {
                foreach (IMapItem item in movePoint.Delete(m_mapDatabase))
                {
                    item.Layer.RemoveItem(item);
                    m_wndMap.DeleteItem(item);
                }
                TreeNode node = m_arbreCartographie.SelectedNode;
                node = GetNodeIElementDeGpsCarte(node);
                if (node != null)
                {
                    IElementDeGPSCarte elt = node.Tag as IElementDeGPSCarte;
                    if (elt != null)
                    {
                        foreach (IMapItem item in elt.FindMapItems(m_mapDatabase))
                        {
                            m_wndMap.RefreshItem(item);
                        }
                        FillNodeFromObjet(node, elt);
                        DisplayItemProperties(node);
                    }
                }
            }
        }
예제 #2
0
        private void m_wndMap_OnEarthMouseDown(object sender, EarthMouseEventArgs args)
        {
            m_bIsMoving = false;

            if (m_modeSouris == EModeSouris.AddPoint)
            {
                MouseDownAddPoint(args);
            }
            if (m_modeSouris == EModeSouris.AddLine)
            {
                MouseDownAddLine(args);
            }
            if (m_modeSouris == EModeSouris.Selection && args.Buttons == MouseButtons.Left && m_gestionnaireModeEdition.ModeEdition)
            {
                //Cherche les points moveable
                foreach (IMapItem item in GetLayerMoveOnMap().Items)
                {
                    IWin32MapItem gItem  = m_wndMap.GetGMapItemFromIMapItem(item);
                    GMarkerGoogle marker = gItem as GMarkerGoogle;
                    if (marker.IsMouseOver)
                    {
                        m_movingPoint = gItem.Item.Tag as CMoveablePoint;
                        m_wndMap.CaptureOnMapWindow = true;
                        args.IsProcessed            = true;
                        m_pointStartMove            = args.MousePoint;
                    }
                }
            }
        }
예제 #3
0
        //------------------------------------------------------------------------
        private CMapItemImage CreateMovePoint(CMoveablePoint moveablePoint)
        {
            CMapItemImage item = new CMapItemImage(GetLayerMoveOnMap(), moveablePoint.Point.Latitude, moveablePoint.Point.Longitude, c_strLayerMoveOnMap);

            moveablePoint.ItemSurMap = item;
            item.Tag = moveablePoint;
            m_wndMap.AddMapItem(item);
            return(item);
        }
예제 #4
0
 //------------------------------------------------------------------------
 private void m_wndMap_OnEarthMouseUp(object sender, EarthMouseEventArgs args)
 {
     if (m_movingPoint != null && m_bIsMoving)
     {
         m_wndMap.Cursor = Cursors.SizeAll;
         m_movingPoint.MoveTo(new SLatLong(args.Latitude, args.Longitude));
         foreach (IMapItem item in m_movingPoint.MapItems)
         {
             m_wndMap.RefreshItem(item);
         }
         if (m_movingPoint.ItemSurMap != null)
         {
             m_wndMap.RefreshItem(m_movingPoint.ItemSurMap);
         }
         m_movingPoint = null;
         m_wndMap.CaptureOnMapWindow = false;
         if (m_editeurEnCours != null)
         {
             m_editeurEnCours.RefreshData();
         }
     }
     m_wndMap.Cursor = m_mapCursor;
 }