区域码管理接口
interface IAreaCodeManager
描述: 区域码(国家码 / 时区)管理接口,提供地区变化监听、当前区域码获取、经纬度离线查询国家码、国家码边界数据获取以及离线时区更新能力。通过 AreaCodeManager.get() 获取实例。
包路径: com.autel.drone.sdk.vmodelx.interfaces.IAreaCodeManager
method addAreaCodeChangeListener
fun addAreaCodeChangeListener(listener: AreaCodeChangeListener)
描述: 添加地区区域码变化监听。
输入参数:
- listener: 区域码变化监听器
输出参数: 无
相关参数: AreaCodeChangeListener
method removeAreaCodeChangeListener
fun removeAreaCodeChangeListener(listener: AreaCodeChangeListener)
描述: 移除地区区域码变化监听。
输入参数:
- listener: 要移除的监听器
输出参数: 无
method getAreaCode
fun getAreaCode(): AreaCodeData?
描述: 获取当前区域码数据(可空)。
输入参数: 无
输出参数: AreaCodeData? 当前区域码数据
相关参数: AreaCodeData
method getCountryCodeByLocation
fun getCountryCodeByLocation(
latitude: Double,
longitude: Double,
priorityCode: String? = null,
callback: (String?) -> Unit
)
描述: 通过经纬度离线查询国家码。
输入参数:
- latitude: 纬度
- longitude: 经度
- priorityCode: 优先匹配的国家码,可空
- callback: 回调函数,返回国家码字符串,可能为空
输出参数: 无
method getCountryCodeFeatureCollection
fun getCountryCodeFeatureCollection(
codeList: List<String>,
callback: (String) -> Unit
)
描述: 获取指定国家码列表的边界 GeoJSON 数据(FeatureCollection 序列化字符串)。
输入参数:
- codeList: 国家码列表
- callback: 回调函数,返回 GeoJSON 字符串
输出参数: 无
method isDBLoadFinish
fun isDBLoadFinish(): Boolean
描述: 离线数据库是否加载完成。
输入参数: 无
输出参数: Boolean,true 表示加载完成
method updateTimeZone
fun updateTimeZone(latitude: Double, longitude: Double)
描述: 通过设定 GPS 更新时区:会根据飞机 GPS 计算离线时区;如果查询不到离线时区,外部可设置 GPS 查询。
输入参数:
- latitude: 纬度
- longitude: 经度
输出参数: 无