//
//  AMapBootstrap.swift
//  suixinkan
//
//  高德 SDK 初始化入口。真机构建时 AMAP_ENABLED 生效；模拟器构建时不链接 AMap。
//

import Foundation

#if AMAP_ENABLED
import AMapFoundationKit
import AMapLocationKit
import AMapSearchKit
import MAMapKit

enum AMapBootstrap {
    /// 在 App 启动时调用一次。将 `apiKey` 替换为高德控制台申请的 Key。
    static func configure(apiKey: String) {
        guard !apiKey.isEmpty else { return }

        AMapServices.shared().apiKey = apiKey
        AMapServices.shared().enableHTTPS = true

        AMapSearchAPI.updatePrivacyShow(.didShow, privacyInfo: .didContain)
        AMapSearchAPI.updatePrivacyAgree(.didAgree)
        MAMapView.updatePrivacyShow(.didShow, privacyInfo: .didContain)
        MAMapView.updatePrivacyAgree(.didAgree)
        AMapLocationManager.updatePrivacyShow(.didShow, privacyInfo: .didContain)
        AMapLocationManager.updatePrivacyAgree(.didAgree)
    }
}
#else
enum AMapBootstrap {
    static func configure(apiKey: String) {}
}
#endif
