package com.abbidot.tracker.ui.fragment.map.baidumap

import android.content.Context
import com.baidu.location.BDLocation
import com.baidu.mapapi.map.BaiduMap

/**
 *Created  by .yzq on 2024/5/15/015.
 * @link
 * @description:
 */
class PreviewFencesBaiduMapFragment : BaseBaiduMapFragment() {

    private lateinit var mMapLoadOk: () -> Unit

    companion object {
        @JvmStatic
        fun newInstance(context: Context, mapLoadOk: () -> Unit) =
            PreviewFencesBaiduMapFragment().apply {
                mContext = context
                mMapLoadOk = mapLoadOk
            }
    }

    override fun onMapLoadOk(baiduMap: BaiduMap) {
        startLocation()
        //变量是否初始化
        if (::mMapLoadOk.isInitialized) mMapLoadOk()
    }

    override fun locationSuccess(location: BDLocation?) {
    }
}