فهرست منبع

fix:优化地图一些坐标。

“HeShaoZe” 5 ماه پیش
والد
کامیت
bd0e394de3

+ 1 - 1
assets/string/base/string.xml

@@ -125,7 +125,7 @@
     <string name="friend_edit_remark_title">备注</string>
     <string name="friend_edit_phone_title">手机号</string>
     <string name="friend_edit_block_title">不给Ta看</string>
-    <string name="blocked_friend">屏蔽该好友</string>
+    <string name="blocked_friend">屏蔽该好友</string>
     <string name="block_friend_off">屏蔽好友已关闭</string>
     <string name="friend_delete">删除好友</string>
     <string name="block_friends">屏蔽好友</string>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 563 - 842
lib/data/api/atmob_api.g.dart


+ 11 - 10
lib/di/get_it.config.dart

@@ -1,3 +1,4 @@
+// dart format width=80
 // GENERATED CODE - DO NOT MODIFY BY HAND
 
 // **************************************************************************
@@ -62,15 +63,15 @@ extension GetItInjectableX on _i174.GetIt {
       environmentFilter,
     );
     final networkModule = _$NetworkModule();
+    gh.factory<_i973.SplashController>(() => _i973.SplashController());
+    gh.factory<_i756.TrackDetailController>(
+        () => _i756.TrackDetailController());
     gh.factory<_i256.AboutController>(() => _i256.AboutController());
-    gh.factory<_i923.BrowserController>(() => _i923.BrowserController());
     gh.factory<_i769.FeedBackController>(() => _i769.FeedBackController());
+    gh.factory<_i923.BrowserController>(() => _i923.BrowserController());
     gh.factory<_i779.NewsReportController>(() => _i779.NewsReportController());
     gh.factory<_i108.PermissionSettingController>(
         () => _i108.PermissionSettingController());
-    gh.factory<_i973.SplashController>(() => _i973.SplashController());
-    gh.factory<_i756.TrackDetailController>(
-        () => _i756.TrackDetailController());
     gh.singleton<_i361.Dio>(() => networkModule.createDefaultDio());
     gh.lazySingleton<_i772.InternetConnectionHelper>(
         () => _i772.InternetConnectionHelper());
@@ -84,14 +85,14 @@ extension GetItInjectableX on _i174.GetIt {
         .provideAtmobStreamApi(gh<_i361.Dio>(instanceName: 'stream')));
     gh.lazySingleton<_i20.AccountRepository>(
         () => _i20.AccountRepository(gh<_i243.AtmobApi>()));
-    gh.lazySingleton<_i850.ContactRepository>(
-        () => _i850.ContactRepository(gh<_i243.AtmobApi>()));
+    gh.lazySingleton<_i274.PhoneEventRepository>(
+        () => _i274.PhoneEventRepository(gh<_i243.AtmobApi>()));
     gh.lazySingleton<_i1053.FriendsRepository>(
         () => _i1053.FriendsRepository(gh<_i243.AtmobApi>()));
+    gh.lazySingleton<_i850.ContactRepository>(
+        () => _i850.ContactRepository(gh<_i243.AtmobApi>()));
     gh.lazySingleton<_i791.MessageRepository>(
         () => _i791.MessageRepository(gh<_i243.AtmobApi>()));
-    gh.lazySingleton<_i274.PhoneEventRepository>(
-        () => _i274.PhoneEventRepository(gh<_i243.AtmobApi>()));
     gh.lazySingleton<_i983.UrgentContactRepository>(
         () => _i983.UrgentContactRepository(gh<_i243.AtmobApi>()));
     gh.lazySingleton<_i220.AtmobLocationClient>(
@@ -127,10 +128,10 @@ extension GetItInjectableX on _i174.GetIt {
               gh<_i983.UrgentContactRepository>(),
               gh<_i20.AccountRepository>(),
             ));
-    gh.factory<_i897.AddFriendDialogController>(
-        () => _i897.AddFriendDialogController(gh<_i1053.FriendsRepository>()));
     gh.factory<_i492.FriendSettingController>(
         () => _i492.FriendSettingController(gh<_i1053.FriendsRepository>()));
+    gh.factory<_i897.AddFriendDialogController>(
+        () => _i897.AddFriendDialogController(gh<_i1053.FriendsRepository>()));
     gh.lazySingleton<_i814.MemberRepository>(() => _i814.MemberRepository(
           gh<_i243.AtmobApi>(),
           gh<_i20.AccountRepository>(),

+ 5 - 1
lib/module/track/track_day_detail/track_day_detail_controller.dart

@@ -1,5 +1,6 @@
 import 'dart:async';
 import 'dart:convert';
+import 'dart:io';
 import 'dart:math';
 
 import 'package:flutter/cupertino.dart';
@@ -423,7 +424,10 @@ class TrackDayDetailController extends BaseController {
           latitude: bean.lat,
           longitude: bean.lng,
           markerType: MarkerType.tracePopupPoint,
-          tags: Popup(
+          tags: Platform.isIOS ? Popup(
+            title: bean.addr ?? '',
+            desc: TrackUtil.formatDurationFromMillis(bean.duration),
+          ).toJson() : Popup(
             title: bean.addr ?? '',
             desc: TrackUtil.formatDurationFromMillis(bean.duration),
           ),

+ 17 - 1
lib/resource/assets.gen.dart

@@ -1,3 +1,5 @@
+// dart format width=80
+
 /// GENERATED CODE - DO NOT MODIFY BY HAND
 /// *****************************************************
 ///  FlutterGen
@@ -5,7 +7,7 @@
 
 // coverage:ignore-file
 // ignore_for_file: type=lint
-// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
+// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import
 
 import 'package:flutter/widgets.dart';
 
@@ -867,12 +869,14 @@ class AssetGenImage {
     this._assetName, {
     this.size,
     this.flavors = const {},
+    this.animation,
   });
 
   final String _assetName;
 
   final Size? size;
   final Set<String> flavors;
+  final AssetGenImageAnimation? animation;
 
   Image image({
     Key? key,
@@ -942,3 +946,15 @@ class AssetGenImage {
 
   String get keyName => _assetName;
 }
+
+class AssetGenImageAnimation {
+  const AssetGenImageAnimation({
+    required this.isAnimation,
+    required this.duration,
+    required this.frames,
+  });
+
+  final bool isAnimation;
+  final Duration duration;
+  final int frames;
+}

+ 2 - 1
lib/resource/colors.gen.dart

@@ -1,3 +1,4 @@
+// dart format width=80
 /// GENERATED CODE - DO NOT MODIFY BY HAND
 /// *****************************************************
 ///  FlutterGen
@@ -5,7 +6,7 @@
 
 // coverage:ignore-file
 // ignore_for_file: type=lint
-// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
+// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import
 
 import 'package:flutter/painting.dart';
 import 'package:flutter/material.dart';

+ 2 - 1
lib/resource/fonts.gen.dart

@@ -1,3 +1,4 @@
+// dart format width=80
 /// GENERATED CODE - DO NOT MODIFY BY HAND
 /// *****************************************************
 ///  FlutterGen
@@ -5,7 +6,7 @@
 
 // coverage:ignore-file
 // ignore_for_file: type=lint
-// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
+// ignore_for_file: deprecated_member_use,directives_ordering,implicit_dynamic_list_literal,unnecessary_import
 
 class FontFamily {
   FontFamily._();

+ 2 - 2
lib/resource/string.gen.dart

@@ -107,7 +107,7 @@ class StringName {
   static String get friendEditRemarkTitle => 'friend_edit_remark_title'.tr; // 备注
   static String get friendEditPhoneTitle => 'friend_edit_phone_title'.tr; // 手机号
   static String get friendEditBlockTitle => 'friend_edit_block_title'.tr; // 不给Ta看
-  static String get blockedFriend => 'blocked_friend'.tr; // 屏蔽该好友
+  static String get blockedFriend => 'blocked_friend'.tr; // 屏蔽该好友
   static String get blockFriendOff => 'block_friend_off'.tr; // 屏蔽好友已关闭
   static String get friendDelete => 'friend_delete'.tr; // 删除好友
   static String get blockFriends => 'block_friends'.tr; // 屏蔽好友
@@ -424,7 +424,7 @@ class StringMultiSource {
       'friend_edit_remark_title': '备注',
       'friend_edit_phone_title': '手机号',
       'friend_edit_block_title': '不给Ta看',
-      'blocked_friend': '屏蔽该好友',
+      'blocked_friend': '屏蔽该好友',
       'block_friend_off': '屏蔽好友已关闭',
       'friend_delete': '删除好友',
       'block_friends': '屏蔽好友',

+ 2 - 2
plugins/map_amap_ios/ios/Classes/IndividualToolView/MapAmapMarkerNormalView.swift

@@ -9,9 +9,9 @@ import Foundation
 import MAMapKit
 //import MapKit
 
-class MapAnnotationView: MAPinAnnotationView {
+class MapAmapMarkerNormalView: MAPinAnnotationView {
     
-    static let identifier: String = "MapAnnotationView"
+    static let identifier: String = "MapAmapMarkerNormalView"
 
     var marker: ATMapMarker? {
         didSet {

+ 1 - 1
plugins/map_amap_ios/ios/Classes/IndividualToolView/MapAmapMarkerPictureView.swift

@@ -56,7 +56,7 @@ class MapAmapMarkerPictureView: UIView {
         }
         
         // 尝试从插件资源束加载
-        let bundleURL = Bundle(for: MapAnnotationView.self).url(forResource: "map_amap_ios_image_source", withExtension: "bundle")
+        let bundleURL = Bundle(for: MapAmapMarkerNormalView.self).url(forResource: "map_amap_ios_image_source", withExtension: "bundle")
         if let bundleURL = bundleURL, let resourceBundle = Bundle(url: bundleURL) {
             return UIImage(named: imageName, in: resourceBundle, compatibleWith: nil)
         }

+ 1 - 2
plugins/map_amap_ios/ios/Classes/IndividualToolView/MapAmapMarkerWriterCenterView.swift

@@ -101,8 +101,7 @@ class MapAnnotationAnchorPointView: MAPinAnnotationView {
         }
         
         // 尝试从插件资源束加载
-        let bundleURL = Bundle(for: MapAnnotationView.self).url(forResource: "map_amap_ios_image_source", withExtension: "bundle")
-        print("bundleURLsfsfdsdf-----\(bundleURL)")
+        let bundleURL = Bundle(for: MapAmapMarkerNormalView.self).url(forResource: "map_amap_ios_image_source", withExtension: "bundle")
         if let bundleURL = bundleURL, let resourceBundle = Bundle(url: bundleURL) {
             return UIImage(named: imageName, in: resourceBundle, compatibleWith: nil) ?? UIImage()
         }

+ 12 - 8
plugins/map_amap_ios/ios/Classes/IndividualToolView/MapAmapPopUpWindowView.swift

@@ -12,14 +12,21 @@ import MAMapKit
 
 class MapAmapPopUpWindowView : MAPinAnnotationView {
     
-    static let identifier: String = "MapAnotationBubbleView"
+    static let identifier: String = "MapAmapPopUpWindowView"
 
     var marker: ATMapMarker? {
         didSet {
             updateView()
+            setupZPosition() // 设置层级
         }
     }
     
+    private func setupZPosition() {
+        // 设置一个较高的 zPosition,确保在其他标注之上
+        // 或通过 layer 层级设置
+        self.layer.zPosition = 1000
+    }
+    
     private var allContentView : UIView!
     private var markerContentView : UIView!
     private var bgImageView : UIImageView!
@@ -43,16 +50,13 @@ class MapAmapPopUpWindowView : MAPinAnnotationView {
         self.marker = annotation as? ATMapMarker
         self.isEnabled = marker?.markerType.supportSelected ?? false
         self.isHidden = false
+        setupZPosition()
     }
     
-    /*override init(annotation: MKAnnotation?, reuseIdentifier: String?) {
-        super.init(annotation: annotation, reuseIdentifier: reuseIdentifier)
-        self.marker = annotation as? ATMapMarker
-        self.isEnabled = marker?.markerType.supportSelected ?? false
-        self.isHidden = false
-    }*/
 
     required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+        setupZPosition()
         fatalError("init(coder:) has not been implemented")
     }
     
@@ -208,7 +212,7 @@ class MapAmapPopUpWindowView : MAPinAnnotationView {
         }
         
         // 尝试从插件资源束加载
-        let bundleURL = Bundle(for: MapAnnotationView.self).url(forResource: "map_amap_ios_image_source", withExtension: "bundle")
+        let bundleURL = Bundle(for: MapAmapMarkerNormalView.self).url(forResource: "map_amap_ios_image_source", withExtension: "bundle")
         if let bundleURL = bundleURL, let resourceBundle = Bundle(url: bundleURL) {
             return UIImage(named: imageName, in: resourceBundle, compatibleWith: nil) ?? UIImage()
         }

+ 153 - 92
plugins/map_amap_ios/ios/Classes/MapAmapContentView/MapAmapThemeControl.swift

@@ -55,6 +55,7 @@ class MapAmapThemeControl: UIViewController {
         }
         
         map.delegate = self
+        map.logoCenter = CGPointMake(-100, 0)
         map.isRotateCameraEnabled = false
         map.showsCompass = false
         map.isRotateEnabled = false
@@ -85,6 +86,7 @@ class MapAmapThemeControl: UIViewController {
 //                }
                 var mapMarkerList = [MAPointAnnotation]();
                 for markerItem in markers {
+                    print("markerItemsfsfdsytp---\(markerItem.markerType)---\(String(describing: markerItem.markerName))---\(String(describing: markerItem.tags))")
                     let annotationItem : MyMAPointAnnotation = MyMAPointAnnotation(itemMarker: markerItem)
                     annotationItem.title = markerItem.markerName;
                     annotationItem.coordinate = markerItem.coordinate;
@@ -92,7 +94,7 @@ class MapAmapThemeControl: UIViewController {
                 }
                 self?.autonaviMap.addAnnotations(mapMarkerList)
                // self?.autonaviMap.selectAnnotation(mapMarkerList.first, animated: true)
-                self?.autonaviMap.setZoomLevel(20, animated: true)
+                //self?.autonaviMap.setZoomLevel(20, animated: true)
                 /*if !mapMarkerList.isEmpty {
                     let selectIemt : MAPointAnnotation = mapMarkerList.first!
                     self?.autonaviMap.setCenter(selectIemt.coordinate, animated: true)
@@ -120,6 +122,7 @@ class MapAmapThemeControl: UIViewController {
                 var polyinesList = [MAPolyline]();
                 for polyline in polylines {
                     let polylineItem : MyMAPolyline = MyMAPolyline(coordinates: &polyline.points, count: UInt(polyline.points.count))
+                    print("polylinesfsfs---\(polyline.lineType)")
                     polylineItem.itemPolyLine = polyline
                     polyinesList.append(polylineItem)
                 }
@@ -141,67 +144,6 @@ class MapAmapThemeControl: UIViewController {
                         animated: true
                     )
                 }
-                
-                /*var polyinesList = [MKPolyline]();
-                for polyline in polylines {
-                    let polylineItem : MKPolyline = polyline.polyline
-                    polylineItem.associatedLineId = polyline.id
-                    polylineItem.associatedLineType = polyline.lineType
-                    polylineItem.associatedColor = polyline.color
-                    polylineItem.associatedWidth = polyline.width
-                    polyinesList.append(polylineItem)
-                }
-                self?.mapView.addOverlays(polyinesList)
-                //self?.mapView.addOverlays(polylines.map({ $0.polyline }))
-                if let padding = polylines.last?.mapPadding {
-                    self?.mapView.fitsAllPoints(
-                        points: polylines.last?.points.compactMap({ MKMapPoint($0) }) ?? [],
-                        padding: padding.padding,
-                        animated: true
-                    )
-                }
-                
-                
-                guard let self, !polylines.isEmpty else { return }
-                
-                // 清除旧覆盖物
-                self.autonaviMap.removeOverlays(self.autonaviMap.overlays)
-                
-                // 创建自定义Polyline类数组
-                let customPolylines = polylines.compactMap { polyline -> CustomPolyline? in
-                    // 创建高德地图Polyline
-                    let count = UInt(polyline.points.count)
-                    
-                    guard let mapPolyline = MAPolyline(coordinates:  &polyline.points , count: count) else {
-                        return nil
-                    }
-            
-                    // 使用自定义类包装
-                    return CustomPolyline(
-                        polyline: mapPolyline,
-                        id: polyline.id,
-                        color: polyline.color,
-                        width: polyline.width
-                    )
-                }
-                
-                // 添加新覆盖物
-                self.autonaviMap.addOverlays(customPolylines.map { $0.polyline })
-                
-                // 自动调整视野
-                if let lastPolyline = polylines.last,
-                   let padding = lastPolyline.mapPadding {
-                    self.autonaviMap.showOverlays(
-                        customPolylines.map { $0.polyline },
-                        edgePadding: UIEdgeInsets(
-                            top: padding.top,
-                            left: padding.left,
-                            bottom: padding.bottom,
-                            right: padding.right
-                        ),
-                        animated: true
-                    )
-                }*/
             }
             .store(in: &cancellables)
         
@@ -344,6 +286,66 @@ class MapAmapThemeControl: UIViewController {
             .store(in: &cancellables)*/
     }
     
+    /*var polyinesList = [MKPolyline]();
+    for polyline in polylines {
+        let polylineItem : MKPolyline = polyline.polyline
+        polylineItem.associatedLineId = polyline.id
+        polylineItem.associatedLineType = polyline.lineType
+        polylineItem.associatedColor = polyline.color
+        polylineItem.associatedWidth = polyline.width
+        polyinesList.append(polylineItem)
+    }
+    self?.mapView.addOverlays(polyinesList)
+    //self?.mapView.addOverlays(polylines.map({ $0.polyline }))
+    if let padding = polylines.last?.mapPadding {
+        self?.mapView.fitsAllPoints(
+            points: polylines.last?.points.compactMap({ MKMapPoint($0) }) ?? [],
+            padding: padding.padding,
+            animated: true
+        )
+    }
+    
+    
+    guard let self, !polylines.isEmpty else { return }
+    
+    // 清除旧覆盖物
+    self.autonaviMap.removeOverlays(self.autonaviMap.overlays)
+    
+    // 创建自定义Polyline类数组
+    let customPolylines = polylines.compactMap { polyline -> CustomPolyline? in
+        // 创建高德地图Polyline
+        let count = UInt(polyline.points.count)
+        
+        guard let mapPolyline = MAPolyline(coordinates:  &polyline.points , count: count) else {
+            return nil
+        }
+
+        // 使用自定义类包装
+        return CustomPolyline(
+            polyline: mapPolyline,
+            id: polyline.id,
+            color: polyline.color,
+            width: polyline.width
+        )
+    }
+    
+    // 添加新覆盖物
+    self.autonaviMap.addOverlays(customPolylines.map { $0.polyline })
+    
+    // 自动调整视野
+    if let lastPolyline = polylines.last,
+       let padding = lastPolyline.mapPadding {
+        self.autonaviMap.showOverlays(
+            customPolylines.map { $0.polyline },
+            edgePadding: UIEdgeInsets(
+                top: padding.top,
+                left: padding.left,
+                bottom: padding.bottom,
+                right: padding.right
+            ),
+            animated: true
+        )
+    }*/
     
     /*private func bindViewModel() {
         viewModel.$markers
@@ -466,7 +468,9 @@ extension MapAmapThemeControl : MAMapViewDelegate {
 //            return nil
 //        }
         
+        
         if let myitemAnnotation = annotation as? MyMAPointAnnotation {
+            print("markerItemsfsfdsytp--AT-\(myitemAnnotation.itemMarker.markerType)---\(String(describing: myitemAnnotation.itemMarker.markerName))---\(String(describing: myitemAnnotation.itemMarker.tags))--")
             if myitemAnnotation.itemMarker.markerType.isMapAchorPoint {
                 let annotationView = (mapView.dequeueReusableAnnotationView(withIdentifier: MapAnnotationAnchorPointView.identifier) as? MapAnnotationAnchorPointView) ?? MapAnnotationAnchorPointView(annotation: (myitemAnnotation as MAAnnotation), reuseIdentifier: MapAnnotationAnchorPointView.identifier)
                 annotationView!.marker = myitemAnnotation.itemMarker
@@ -476,40 +480,13 @@ extension MapAmapThemeControl : MAMapViewDelegate {
                 annotationBubbleView!.marker = myitemAnnotation.itemMarker
                 return annotationBubbleView
             }
-            let annotationView = (mapView.dequeueReusableAnnotationView(withIdentifier: MapAnnotationView.identifier) as? MapAnnotationView) ?? MapAnnotationView(annotation: (myitemAnnotation as MAAnnotation), reuseIdentifier: MapAnnotationView.identifier)
+            let annotationView = (mapView.dequeueReusableAnnotationView(withIdentifier: MapAmapMarkerNormalView.identifier) as? MapAmapMarkerNormalView) ?? MapAmapMarkerNormalView(annotation: (myitemAnnotation as MAAnnotation), reuseIdentifier: MapAmapMarkerNormalView.identifier)
             annotationView!.marker = myitemAnnotation.itemMarker
             return annotationView
         }
         return nil
-
-        
-        /*if annotation is MyMAPointAnnotation,let myitemAnnotation = annotation as? MyMAPointAnnotation {
-            
-            
-            let pointReuseIdentifier = "pointReuseIndetifier"
-            var annotationView = mapView.dequeueReusableAnnotationView(
-                withIdentifier: pointReuseIdentifier
-            ) as? MAPinAnnotationView
-            
-            if annotationView == nil {
-                annotationView = MAPinAnnotationView(
-                    annotation: annotation,
-                    reuseIdentifier: pointReuseIdentifier
-                )
-            }
-            
-            annotationView?.canShowCallout = true
-            annotationView?.animatesDrop = true
-            annotationView?.isDraggable = false
-            annotationView?.pinColor = .purple
-            
-            return annotationView
-        }
-        
-        return nil*/
     }
     
-    
     func mapView(_ mapView: MAMapView!, rendererFor overlay: MAOverlay!) -> MAOverlayRenderer! {
         guard let polyline = overlay as? MyMAPolyline else {
               return  MAPolylineRenderer(polyline: overlay as? MAPolyline)
@@ -525,6 +502,7 @@ extension MapAmapThemeControl : MAMapViewDelegate {
         renderer?.lineCapType = kMALineCapRound//kMALineCapArrow
         renderer?.lineJoinType = kMALineJoinRound
         
+        print("lineTypesfsdfsdf---\(polyline.itemPolyLine.lineType)----\(polyline.itemPolyLine.lineId)")
     // 设置箭头样式
         // 加载箭头纹理图片
         //normal error selected color
@@ -548,13 +526,54 @@ extension MapAmapThemeControl : MAMapViewDelegate {
       }
     
     
+    func mapView(_ mapView: MAMapView, didFailToLocateUserWithError error: Error?) {
+        guard let error = error else { return }
+        
+        // 打印错误信息,便于调试
+        print("定位失败: \(error.localizedDescription)")
+        
+        // 根据错误类型处理黑屏问题
+        handleLocationError(error: error as NSError)
+        
+        // 即使定位失败,也显示默认地图(避免黑屏)
+        mapView.showsUserLocation = true // 显示用户位置(即使定位失败)
+        mapView.userTrackingMode = .follow // 设置跟踪模式
+    }
+    
+    
+    private func handleLocationError(error: NSError) {
+        switch error.code {
+        case CLError.denied.rawValue:
+            // 权限被拒绝
+            showPermissionAlert()
+            print("权限被拒绝")
+            
+        case CLError.locationUnknown.rawValue:
+            // 位置未知(临时错误)
+            print("位置未知(临时错误)")
+            
+        case CLError.network.rawValue:
+            // 网络错误
+            print("网络错误")
+            
+        case CLError.headingFailure.rawValue:
+            // 方向获取失败(不影响定位,可忽略)
+            print("方向获取失败,但位置可能正常")
+            
+        default:
+            // 其他错误
+            print("其他错误")
+        }
+    }
+    
+
     private func readImageContentFrom(imageName : String) -> UIImage {
         if let image = UIImage(named: imageName) {
             return image
         }
         
         // 尝试从插件资源束加载
-        let bundleURL = Bundle(for: MapAnnotationView.self).url(forResource: "map_amap_ios_image_source", withExtension: "bundle")
+        let bundleURL = Bundle(for: MapAmapMarkerNormalView.self).url(forResource: "map_amap_ios_image_source", withExtension: "bundle")
         if let bundleURL = bundleURL, let resourceBundle = Bundle(url: bundleURL) {
             return UIImage(named: imageName, in: resourceBundle, compatibleWith: nil) ?? UIImage()
         }
@@ -562,6 +581,48 @@ extension MapAmapThemeControl : MAMapViewDelegate {
         return  UIImage()
     }
     
+    
+    private func showPermissionAlert() {
+        let alert = UIAlertController(
+            title: "定位权限被拒绝",
+            message: "请在设置中为高德地图开启位置权限",
+            preferredStyle: .alert
+        )
+        
+        alert.addAction(UIAlertAction(title: "取消", style: .cancel))
+        alert.addAction(UIAlertAction(title: "去设置", style: .default) { _ in
+            // 打开系统设置中的应用权限页面
+            if let url = URL(string: UIApplication.openSettingsURLString) {
+                UIApplication.shared.open(url)
+            }
+        })
+        
+        present(alert, animated: true)
+    }
+    
+    
+    private func showDefaultMap() {
+        // 如果有历史位置,使用历史位置
+        if let lastLocation = self.autonaviMap.userLocation.location {
+            let region = MACoordinateRegion(
+                center: lastLocation.coordinate,
+                span: MACoordinateSpan(latitudeDelta: 0.1, longitudeDelta: 0.1)
+            )
+            autonaviMap.setRegion(region, animated: true)
+        } else {
+            // 没有历史位置,使用默认区域(如北京)
+            let defaultLocation = CLLocationCoordinate2D(latitude: 39.9042, longitude: 116.4074)
+            let region = MACoordinateRegion(
+                center: defaultLocation,
+                span: MACoordinateSpan(latitudeDelta: 0.1, longitudeDelta: 0.1)
+            )
+            autonaviMap.setRegion(region, animated: true)
+        }
+        
+        // 确保地图可见元素正常显示
+        autonaviMap.isShowsBuildings = true
+        autonaviMap.isShowTraffic = false // 根据需要显示交通
+    }
 }
 
 
@@ -584,7 +645,7 @@ extension MapAmapThemeControl: MKMapViewDelegate {
             annotationBubbleView.prepareForDisplay()
             return annotationBubbleView
         }
-        let annotationView = (mapView.dequeueReusableAnnotationView(withIdentifier: MapAnnotationView.identifier) as? MapAnnotationView) ?? MapAnnotationView(annotation: marker, reuseIdentifier: MapAnnotationView.identifier)
+        let annotationView = (mapView.dequeueReusableAnnotationView(withIdentifier: MapAmapMarkerNormalView.identifier) as? MapAmapMarkerNormalView) ?? MapAmapMarkerNormalView(annotation: marker, reuseIdentifier: MapAmapMarkerNormalView.identifier)
         annotationView.marker = marker
         annotationView.prepareForDisplay()
         return annotationView

+ 35 - 14
plugins/map_amap_ios/ios/Classes/ViewAndDataExchange/MapAmapViewAndDataExchange.swift

@@ -63,21 +63,25 @@ class MapAmapViewAndDataExchange: NSObject, ObservableObject, MapCapability {
         for marker in newMarkers {
             markerDict[marker.id] = marker
         }
-        
-        self.markers = Array(markerDict.values)
+        DispatchQueue.main.async{
+            self.markers = Array(markerDict.values)
+        }
         result(nil)
     }
     
     // 处理地图清除Marker
     func handleMapClearMarkers(result: @escaping FlutterResult) {
-        markers = []
-        polylines = []
+        DispatchQueue.main.async{
+            self.markers = []
+        }
         result(nil)
     }
     
     //处理地图所有plolines
     func handleMapClearAllPolyline(result: @escaping FlutterResult) {
-        polylines = []
+        DispatchQueue.main.async{
+            self.polylines = []
+        }
         result(nil)
     }
     
@@ -90,8 +94,9 @@ class MapAmapViewAndDataExchange: NSObject, ObservableObject, MapCapability {
             result(paramsDecodeError)
             return
         }
-        
-        self.markers = markers
+        DispatchQueue.main.async{
+            self.markers = markers
+        }
     }
     
     // 处理Marker点击事件
@@ -106,8 +111,11 @@ class MapAmapViewAndDataExchange: NSObject, ObservableObject, MapCapability {
             result(paramsDecodeError)
             return
         }
-        polylines.append(polyline)
         
+        DispatchQueue.main.async{
+            self.polylines.append(polyline)
+        }
+ 
         result(nil)
     }
     
@@ -117,20 +125,23 @@ class MapAmapViewAndDataExchange: NSObject, ObservableObject, MapCapability {
             result(paramsDecodeError);
             return;
         }
-        suitableLocation.append(polyline)
+        DispatchQueue.main.async{
+            self.suitableLocation.append(polyline)
+        }
         result(nil);
     }
     
     ///清除指定标记物
     func handleMapRemovemarker(args: [String : Any]?, result: @escaping FlutterResult) {
+        var fixArge : [String : Any] = args ?? [String : Any]()
+        fixArge["id"] = "0"
         defer {
             result(nil)
         }
-        guard let args = args, let markerItem = ATMapMarker.fromJson(json: args) else {
+        guard let markerItem = ATMapMarker.fromJson(json: fixArge) else {
             result(paramsDecodeError)
             return
         }
-        
         // 使用标识符找到要移除的标记物并从数组中删除
         
         DispatchQueue.main.async{
@@ -148,7 +159,13 @@ class MapAmapViewAndDataExchange: NSObject, ObservableObject, MapCapability {
         }
         DispatchQueue.main.async {
             if let index = self.polylines.firstIndex(where: { $0.lineId == polyline.lineId }) {
-                self.polylines.remove(at: index)
+                var changeArray : [ATMapPolyline] = []
+                for itemPoly in self.polylines {
+                    changeArray.append(itemPoly)
+                }
+                changeArray.remove(at: index)
+                self.polylines = changeArray
+                //self.polylines.remove(at: index)
             }
         }
         result(nil)
@@ -157,7 +174,9 @@ class MapAmapViewAndDataExchange: NSObject, ObservableObject, MapCapability {
     ///禁用或开启地图所有交互
     func handleMapInteractionEnabled(args: [String: Any]?, result: @escaping FlutterResult) {
         if let enabled = args?["enabled"] {
-            self.interactionEnabled = "\(enabled)";
+            DispatchQueue.main.async{
+                self.interactionEnabled = "\(enabled)";
+            }
         }
         result(nil)
     }
@@ -165,7 +184,9 @@ class MapAmapViewAndDataExchange: NSObject, ObservableObject, MapCapability {
     ///显示或隐藏地图logo
     func handleMapLogoVisible(args: [String : Any]?, result: @escaping FlutterResult) {
         if let visible = args?["visible"] {
-            self.logoVisible = "\(visible)";
+            DispatchQueue.main.async{
+                self.logoVisible = "\(visible)";
+            }
         }
         result(nil)
     }

+ 1 - 0
plugins/map_mapkit_ios/ios/Classes/MapView/ViewModel/MapViewModel.swift

@@ -52,6 +52,7 @@ class MapViewModel: NSObject, ObservableObject, MapCapability {
     
     // 处理地图添加Marker
     func handleMapAddMarker(args: [[String: Any]]?, result: @escaping FlutterResult) {
+    
         guard let args = args, let newMarkers = [ATMapMarker].fromJson(json: args) else {
             result(paramsDecodeError)
             return