|
|
@@ -152,7 +152,12 @@ class ATMapMarker: NSObject, Codable {
|
|
|
markerType = MarkerTypeFactory.markerType(from: rawValue)
|
|
|
|
|
|
///气泡内容
|
|
|
- tags = try container.decode([String : String].self, forKey: .tags)
|
|
|
+ // 处理tags为空的情况
|
|
|
+ if container.contains(.tags) {
|
|
|
+ tags = try container.decodeIfPresent([String: String].self, forKey: .tags) ?? [:]
|
|
|
+ } else {
|
|
|
+ tags = [:] // 默认为空字典
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func encode(to encoder: Encoder) throws {
|