package com.casic.detector.utils

import android.content.Context
import android.graphics.Color
import com.amap.api.maps.model.LatLng
import com.amap.api.maps.model.Poi
import com.casic.detector.extensions.showBusRouteOnMap
import com.casic.detector.extensions.showRideRouteOnMap
import com.casic.detector.extensions.showRouteOnMap
import com.pengxh.kt.lite.widget.dialog.BottomActionSheet

object RouteOnMap {
    fun startNavigation(context: Context, s: String, latlng: LatLng) {
        BottomActionSheet.Builder()
            .setContext(context)
            .setItemTextColor(Color.BLUE)
            .setActionItemTitle(arrayListOf("步行导航", "骑行导航", "驾驶模式"))
            .setOnActionSheetListener(object :
                BottomActionSheet.OnActionSheetListener {
                override fun onActionItemClick(position: Int) {
                    when (position) {
                        0 -> Poi(s, latlng, "").showRouteOnMap(context)
                        1 -> Poi(s, latlng, "").showRideRouteOnMap(context)
                        2 -> Poi(s, latlng, "").showBusRouteOnMap(context)
                    }
                }
            }).build().show()
    }
}