From 13caafbbb1c35cd70a3923e69d75f1696feef99c Mon Sep 17 00:00:00 2001 From: cbwu <504-wuchengbo@htsdfp.com> Date: Thu, 9 Nov 2023 13:56:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=B1=8F=E8=94=BD=E9=AB=98?= =?UTF-8?q?=E7=A8=8B=E5=88=86=E6=9E=90=E7=9A=84=E6=A0=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GISDlg.cpp | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/GISDlg.cpp b/GISDlg.cpp index 3060714..b2ecb36 100644 --- a/GISDlg.cpp +++ b/GISDlg.cpp @@ -908,6 +908,7 @@ void CGISDlg::OnMapMove() m_bLDSetPoint = FALSE; m_bSelectFeatureFlag = false; + } @@ -2155,6 +2156,9 @@ void CGISDlg::MouseDownMap1(short Button, short Shift, long x, long y) return; } + + OnShowRMenu(); + /* //当处于回放模式时,设置、导引操作、航线装订子菜单都先灰色 menu.LoadMenu(IDR_MENU2); @@ -2208,7 +2212,7 @@ void CGISDlg::MouseDownMap1(short Button, short Shift, long x, long y) menu.CheckMenuItem( IDM_SHOW_LINE5, MF_BYCOMMAND | MF_UNCHECKED ); } -/* + //航线6 if (m_pHaveDrawLineFlag[5]) { @@ -2254,7 +2258,7 @@ void CGISDlg::MouseDownMap1(short Button, short Shift, long x, long y) else { menu.CheckMenuItem( IDM_SHOW_LINE10, MF_BYCOMMAND | MF_UNCHECKED ); - }*/ + } //航线14 回收航线 @@ -2334,7 +2338,7 @@ void CGISDlg::MouseDownMap1(short Button, short Shift, long x, long y) //弹出快捷菜单 menu.GetSubMenu( 0 )->TrackPopupMenu( TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, this ); - + */ //像素坐标转经纬度坐标 m_map.PixelToProj(x, y, &m_guidePtInfo.guidePtLon, &m_guidePtInfo.guidePtLat); } @@ -2391,18 +2395,19 @@ void CGISDlg::MouseDownMap1(short Button, short Shift, long x, long y) //高程分析选点 if (g_bDemAnalysising && (Button == 1)) { + g_iDemPointNum++; //像素坐标转经纬度坐标 double _ptLon = 0.0, _ptLat = 0.0; m_map.PixelToProj(x, y, &_ptLon, &_ptLat); - + g_dDemPtLon[g_iDemPointNum-1] = _ptLon; g_dDemPtLat[g_iDemPointNum-1] = _ptLat; - + return; CString str; str.Format(_T("%d"), g_iDemPointNum); - + //显示点的序号标注 AddTextToPointShapeLayer(g_lDemPtNumLayerID[g_iDemPointNum-1], _ptLon, _ptLat, str, _T(""), RGB(255,0,0)); @@ -2419,6 +2424,7 @@ void CGISDlg::MouseDownMap1(short Button, short Shift, long x, long y) m_DlgDemAlt.ShowWindow(TRUE); } } + } //选择导引点 @@ -2798,7 +2804,7 @@ void CGISDlg::MouseMoveMap1(short Button, short Shift, long x, long y) AddPointShapeLayer(m_longLabelPlotID,_ptLon, _ptLat, str, _T("红色"), RGB(255,0,0)); } - if (g_bDemAnalysising && g_iDemPointNum>=1) + if (g_bDemAnalysising && g_iDemPointNum>=1 ) { double lon = 0, lat = 0; m_map.PixelToProj(x, y, &lon, &lat); @@ -2819,7 +2825,13 @@ void CGISDlg::MouseMoveMap1(short Button, short Shift, long x, long y) AddOnePoint2Shapfile(g_lDemAltLayerID[g_iDemPointNum-1], 1, lon, lat); //显示线段的距离和方位 - DrawLineLabel(g_lDemAltDisLayerID[g_iDemPointNum-1], g_dDemPtLon[g_iDemPointNum-1], g_dDemPtLat[g_iDemPointNum-1], lon, lat); +/* + if (g_lDemAltDisLayerID[g_iDemPointNum-1]!=-1) + { + m_map.ClearDrawing(g_lDemAltDisLayerID[g_iDemPointNum-1]); + } + g_lDemAltDisLayerID[g_iDemPointNum-1] = m_map.NewDrawing(1);*/ + //DrawLineLabel(g_lDemAltDisLayerID[g_iDemPointNum-1], g_dDemPtLon[g_iDemPointNum-1], g_dDemPtLat[g_iDemPointNum-1], lon, lat); } } @@ -2922,15 +2934,23 @@ void CGISDlg::DrawLineLabel(long &drawLayerID, const double ptLon1, const double //Label集合 CLabels labesPtr; labesPtr = (m_map.GetShapefile(drawLayerID)).GetLabels(); + //labesPtr = m_map.GetDrawingLabels(drawLayerID); + + labesPtr.SetFontColor(RGB(255,255,0)); + labesPtr.SetAlignment(1); + labesPtr.SetFontBold(TRUE); + labesPtr.SetFontName(_T("Times New Roman")); + labesPtr.SetFontSize(10); - CLabelCategory labelCategory = labesPtr.AddCategory(_T("")); + //CLabelCategory labelCategory = labesPtr.AddCategory(_T("")); +/* labelCategory.SetFontColor(RGB(255,255,0)); labelCategory.SetAlignment(1); labelCategory.SetFontBold(TRUE); labelCategory.SetFontName(_T("Times New Roman")); - labelCategory.SetFontSize(10); + labelCategory.SetFontSize(10);*/ - labesPtr.AddLabel(str, textLon, textLat, 0, 0); + labesPtr.AddLabel((LPCTSTR)str, textLon, textLat, 0, 0); //4.9版本此处有问题,会导致程序崩溃 } //重绘