eagle_1030 迈速表限速信息从高精地图获取
This commit is contained in:
@@ -24,6 +24,7 @@ import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
import com.mogo.utils.UiThreadHandler
|
||||
import com.mogo.utils.logger.Logger
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
@@ -49,6 +50,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
|
||||
var mLatLng: Location? = null
|
||||
|
||||
var mSpeedLimmit = 60;
|
||||
init {
|
||||
initEvent(context)
|
||||
|
||||
@@ -114,11 +116,13 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
private val timerTask = object : TimerTask() {
|
||||
override fun run() {
|
||||
if (mLatLng != null) {
|
||||
mSpeedLimmit = mMogoServiceApis.mapServiceApi.mapUIController.getSpeedLimmit(mLatLng!!.longitude, mLatLng!!.latitude, mLatLng!!.bearing)
|
||||
Logger.e("lianglihui","mSpeedLimmit="+mSpeedLimmit)
|
||||
UiThreadHandler.post {
|
||||
val speed = (mLatLng!!.speed * 3.6f).toInt()
|
||||
mSpeedChartView.setArcColor(Color.parseColor(if (speed > 60) "#DB3137" else "#3E77F6"))
|
||||
mSpeedChartView.setArcColor(Color.parseColor(if (speed > mSpeedLimmit) "#DB3137" else "#3E77F6"))
|
||||
mSpeedChartView.setValues(speed)
|
||||
setBackgroundResource(if (speed > 60) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor)
|
||||
setBackgroundResource(if (speed > mSpeedLimmit) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user