From 46fb1aa9d06210467c79188938499c854c0563e5 Mon Sep 17 00:00:00 2001 From: Sean Date: Fri, 12 Apr 2024 13:40:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=B5=8Bregion=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=90=88=E8=A7=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinAppletExt/Common/Util/Map/FATMapViewController.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ios/Classes/FinAppletExt/Common/Util/Map/FATMapViewController.m b/ios/Classes/FinAppletExt/Common/Util/Map/FATMapViewController.m index f36d987..9f5b2fa 100644 --- a/ios/Classes/FinAppletExt/Common/Util/Map/FATMapViewController.m +++ b/ios/Classes/FinAppletExt/Common/Util/Map/FATMapViewController.m @@ -199,6 +199,15 @@ static NSString *kUserAnnotationId = @"FATUserAnnotationViewId"; CLLocationCoordinate2D centerCoord = {[self judgeLatition:[self.latitude doubleValue]], [self judgeLongitude:[self.longitude doubleValue]]}; MKCoordinateRegion region = MKCoordinateRegionMake(centerCoord, MKCoordinateSpanMake(LongitudeDelta, LongitudeDelta)); + CLLocationCoordinate2D center = region.center; + MKCoordinateSpan span = region.span; + if (center.latitude < -90 || center.latitude > 90 || + center.longitude < -180 || center.longitude > 180) { + return ; + } + if (span.latitudeDelta <= 0 || span.longitudeDelta <= 0) { + return ; + } [self.mapView setRegion:region animated:YES]; }