ソースを参照

fix:锚点的样式新添加,添加冒泡的内容。

“HeShaoZe” 4 ヶ月 前
コミット
269ffb0198

+ 9 - 0
plugins/map_mapkit_ios/ios/Classes/MapView/Model/MapMarkerSupportType.swift

@@ -46,6 +46,9 @@ enum MarkerType: Int, MapMarkerSupportType {
     case traceStart = 3
     case traceEndFriend = 4
     case traceEndMine = 5
+    case tracePopup = 6 //popup气泡样式
+    case tracePassing = 7 //轨迹途径点样式
+    case trackError = 8 //轨迹错误点样式
     
     var supportSelected: Bool {
         return self == .mine
@@ -63,6 +66,12 @@ enum MarkerType: Int, MapMarkerSupportType {
                 "traceEndFriend"
             case .traceEndMine:
                 "traceEndMine"
+            case .tracePopup:
+                "tracePopup"
+            case .tracePassing:
+                "tracePassing"
+            case .trackError:
+                "trackError"
         }
         return "\(prefixName)_\(imageBaseName)" + ((selected && supportSelected) ? "_selected" : "")
     }

+ 8 - 2
plugins/map_mapkit_ios/ios/Classes/MapView/Model/Models.swift

@@ -109,8 +109,9 @@ class ATMapMarker: NSObject, Codable {
     var longitude: CGFloat
     var isSelected: Bool
     var markerType: any MapMarkerSupportType
+    var tags: [String : String]?
 
-    init(id: String, markerName: String?, customAvatarUrl: String?,location: CLLocationCoordinate2D, markerType: any MapMarkerSupportType, isSelected: Bool = false) {
+    init(id: String, markerName: String?, customAvatarUrl: String?,location: CLLocationCoordinate2D, markerType: any MapMarkerSupportType, isSelected: Bool = false,tags: [String : String]?) {
         self.id = id
         self.markerName = markerName
         self.customAvatarUrl = customAvatarUrl
@@ -118,6 +119,7 @@ class ATMapMarker: NSObject, Codable {
         self.longitude = location.longitude
         self.markerType = markerType
         self.isSelected = isSelected
+        self.tags = tags
     }
     
     func update(coordinate: CLLocationCoordinate2D, name: String? = nil, isSelect: Bool) {
@@ -128,7 +130,7 @@ class ATMapMarker: NSObject, Codable {
     }
 
     enum CodingKeys: String, CodingKey {
-        case id, markerName,customAvatarUrl, latitude, longitude, isSelected, markerType
+        case id, markerName,customAvatarUrl, latitude, longitude, isSelected, markerType,tags
     }
 
     required init(from decoder: Decoder) throws {
@@ -150,6 +152,9 @@ class ATMapMarker: NSObject, Codable {
         // 使用工厂方法创建正确类型的markerType
         let rawValue = try container.decode(Int.self, forKey: .markerType)
         markerType = MarkerTypeFactory.markerType(from: rawValue)
+        
+        ///气泡内容
+        tags = try container.decode([String : String].self, forKey: .tags)
     }
 
     func encode(to encoder: Encoder) throws {
@@ -161,6 +166,7 @@ class ATMapMarker: NSObject, Codable {
         try container.encode(longitude, forKey: .longitude)
         try container.encode(isSelected, forKey: .isSelected)
         try container.encode(markerType.rawValue, forKey: .markerType)
+        try container.encode(tags, forKey: .tags)
     }
 }