package com.abbidot.tracker.ui.common.map

import android.content.Context
import androidx.fragment.app.Fragment
import com.abbidot.baselibrary.util.AppUtils
import com.abbidot.tracker.deprecated.ui.fragment.map.baidumap.NavigationBaiduMapFragment
import com.abbidot.tracker.deprecated.ui.fragment.map.googlemap.NavigationGoogleMapFragment

/**
 *Created  by .yzq on 2022/7/5/005.
 * @link
 * @description:
 */
class NavigationMapCommon {

    private var mNavigationGoogleMapFragment: NavigationGoogleMapFragment? = null
    private var mNavigationBaiduMapFragment: NavigationBaiduMapFragment? = null

    fun getMapFragment(context: Context,imageUrl: String): Fragment {
        return if (AppUtils.isChina(AppUtils.SWITCH_MAP_TYPE)) {
            mNavigationBaiduMapFragment = NavigationBaiduMapFragment.newInstance(context)
            mNavigationBaiduMapFragment!!.mPetHeadUrl = imageUrl
            mNavigationBaiduMapFragment!!
        } else {
            mNavigationGoogleMapFragment = NavigationGoogleMapFragment.newInstance(context)
            mNavigationGoogleMapFragment!!.mPetHeadUrl = imageUrl
            mNavigationGoogleMapFragment!!
        }
    }
}