唐浩
3 天以前 c92e2c6ba9176a971802e2217e0661dec03286b7
app/src/main/java/com/zhaoyang/driver/ui/main/TripActivity.kt
@@ -180,6 +180,20 @@
        handler?.postDelayed({ checkOrderStatue() }, 3000)
    }
    override fun onResume() {
        super.onResume()
        map_view.onResume()
    }
    override fun onPause() {
        super.onPause()
        map_view.onPause()
    }
    override fun onLowMemory() {
        super.onLowMemory()
        map_view.onLowMemory()
    }
    override fun onBackPressed() {
        EventBus.getDefault().post(BaseEvent(BaseEvent.UPDATA_MAIN_CAR))
@@ -305,6 +319,11 @@
                                    )
                                    finish()
                                    aMapTrackClient.stopGather(this) //停止轨迹采集
                                    val trackParam = TrackParam(serviceIdS, terminalId)
                                    if (!orderBean.data.trackId.isNullOrEmpty()){
                                        trackParam.trackId = orderBean.data.trackId.toLong()
                                        aMapTrackClient.stopTrack(trackParam,this)
                                    }
                                }
                            }
                        }
@@ -429,13 +448,14 @@
     */
    private fun initMineLocation() {
        AMapKit.initLocation(this, AMapLocationListener {
            it?.let {
            if (it!=null&&it.errorCode == 0){
                MyApplication.aMapLocation = it
                carMarker?.position = LatLng(it.latitude, it.longitude)
                graylist.add(LatLng(it.latitude, it.longitude))
                grayline?.remove()
                grayline = AMapKit.drawLine(this,aMap,graylist,R.color.gray)
//                queryTrack() //debug调用
            }else{
                MyApplication.aMapLocation = null
            }
            orderBean.let {
                when (it.data.orderState) {
@@ -704,6 +724,12 @@
            handler?.removeCallbacksAndMessages(null)
        }
        closeTimeStart()
        map_view.onDestroy()
    }
    override fun onSaveInstanceState(outState: Bundle) {
        super.onSaveInstanceState(outState)
        map_view.onSaveInstanceState(outState)
    }