From 3868efc58fa1522ee56fbac2191ff39711eb824c Mon Sep 17 00:00:00 2001
From: cbwu <504-wuchengbo@htsdfp.com>
Date: Thu, 11 Apr 2024 17:09:47 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=99=90=E5=88=B6?=
 =?UTF-8?q?=E5=8C=BA=E8=AE=BE=E8=AE=A1=E7=9A=84bug=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 GISDlg.cpp | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/GISDlg.cpp b/GISDlg.cpp
index 77f9433..ee1e098 100644
--- a/GISDlg.cpp
+++ b/GISDlg.cpp
@@ -2685,7 +2685,7 @@ void CGISDlg::MouseMoveMap1(short Button, short Shift, long x, long y)
 		double yPoints[5];
 		double endPoint[2] = {dX,dY};
 		ComputeRectanglePoints(firstZonePoint,endPoint,xPoints,yPoints);
-		DrawRestrictedZone(noFlyZoneLayersID[0],xPoints,yPoints,5,1);
+		DrawRestrictedZone(m_tempZoneLayerID,xPoints,yPoints,5,1);
 		m_map.Redraw();
 	}
 
@@ -4933,7 +4933,7 @@ void CGISDlg::OnShowGivenLine(const CString strLineFileName)
 		}
 
 		int ch = lineDataGroup.linePts[lineDataGroup.pointNum-1].ch1;
-		if (ch==0x0C) //�޷���
+		if (ch==0x0D) //�޷���
 		{
 			//ClearZoneLayer(restrictedZoneLayersID[lineDataGroup.lineID-1]);
 			double xPoints[5];
@@ -4946,7 +4946,7 @@ void CGISDlg::OnShowGivenLine(const CString strLineFileName)
 			DrawRestrictedZone(restrictedZoneLayersID[lineDataGroup.lineID-1],xPoints,yPoints,5,0);
 			return;
 		}
-		else if(ch == 0x0D) //������
+		else if(ch == 0x0C) //������
 		{
 			double xPoints[5];
 			double yPoints[5];
@@ -7732,11 +7732,15 @@ void CGISDlg::ShowSaveZoneDlg(double* xPoints,double* yPoints)
 			
 			fclose(fp);
 		}
+		if (m_tempZoneLayerID>=0)
+		{
+			m_map.RemoveLayer(m_tempZoneLayerID);
+			m_tempZoneLayerID = -1;
+		}
 		//��ʾ����
 		OnShowGivenLine(filename);
+		m_map.Redraw();
 	}
-	m_map.RemoveLayer(m_tempZoneLayerID);
-	m_map.Redraw();
 	
 }