[6.2.0] add func of over take limit set
This commit is contained in:
@@ -124,7 +124,9 @@ class SmallMapView @JvmOverloads constructor(
|
||||
// 绘制线
|
||||
mPolyline?.points = mCoordinatesLatLng
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAP + TAG, "SmallMapView drawPolyline size is = ${mCoordinatesLatLng.size} ")
|
||||
SceneConstant.M_MAP + TAG,
|
||||
"SmallMapView drawPolyline size is = ${mCoordinatesLatLng.size} "
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,21 +172,18 @@ class SmallMapView @JvmOverloads constructor(
|
||||
// 关闭显示实时路况图层,aMap是地图控制器对象。
|
||||
mAMap?.isTrafficEnabled = false
|
||||
// 设置 锚点 图标
|
||||
mCarMarker = if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
|| AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)
|
||||
|| AppIdentityModeUtils.isCharter(FunctionBuildConfig.appIdentityMode)) {
|
||||
mAMap?.addMarker(
|
||||
MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.map_bus_icon))
|
||||
.anchor(0.5f, 0.5f)
|
||||
)
|
||||
val iconRes = if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
R.drawable.map_bus_icon
|
||||
} else if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
|
||||
R.drawable.map_m2_icon
|
||||
} else {
|
||||
mAMap?.addMarker(
|
||||
MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.map_car_icon))
|
||||
.anchor(0.5f, 0.5f)
|
||||
)
|
||||
R.drawable.map_car_icon
|
||||
}
|
||||
mCarMarker = mAMap?.addMarker(
|
||||
MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(iconRes))
|
||||
.anchor(0.5f, 0.5f)
|
||||
)
|
||||
mStartMarker = mAMap?.addMarker(
|
||||
MarkerOptions()
|
||||
.icon(BitmapDescriptorFactory.fromResource(R.drawable.module_small_map_view_dir_start))
|
||||
@@ -294,7 +293,9 @@ class SmallMapView @JvmOverloads constructor(
|
||||
)
|
||||
if (calculateDistance <= 5) {
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAP + TAG, "onChassisLocationGCJ02 -----> calculateDistance <= 5 ")
|
||||
SceneConstant.M_MAP + TAG,
|
||||
"onChassisLocationGCJ02 -----> calculateDistance <= 5 "
|
||||
)
|
||||
clearPolyline()
|
||||
mCoordinatesLatLng.clear()
|
||||
}
|
||||
@@ -312,9 +313,9 @@ class SmallMapView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onAutopilotStatusResponse(state: Int) {
|
||||
if(state == 2){
|
||||
if (state == 2) {
|
||||
drawRotting()
|
||||
}else{
|
||||
} else {
|
||||
UiThreadHandler.post {
|
||||
clearPolyline()
|
||||
}
|
||||
@@ -323,7 +324,7 @@ class SmallMapView @JvmOverloads constructor(
|
||||
|
||||
override fun onAutopilotRouteLineId(lineId: Long) {
|
||||
super.onAutopilotRouteLineId(lineId)
|
||||
if(lineId == 0L){
|
||||
if (lineId == 0L) {
|
||||
this.globalPathResp = null
|
||||
UiThreadHandler.post {
|
||||
clearPolyline()
|
||||
@@ -331,14 +332,15 @@ class SmallMapView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun drawRotting(){
|
||||
private fun drawRotting() {
|
||||
globalPathResp?.let {
|
||||
val latLngList: MutableList<MogoLatLng> = ArrayList()
|
||||
for (routeModel in globalPathResp!!.wayPointsList) {
|
||||
latLngList.add(MogoLatLng(routeModel.latitude, routeModel.longitude))
|
||||
}
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAP + TAG, "SmallMapView latLngList.size = ${latLngList.size}")
|
||||
SceneConstant.M_MAP + TAG, "SmallMapView latLngList.size = ${latLngList.size}"
|
||||
)
|
||||
if (latLngList.size > 0) {
|
||||
UiThreadHandler.post {
|
||||
convert(latLngList)
|
||||
@@ -347,7 +349,9 @@ class SmallMapView @JvmOverloads constructor(
|
||||
} else {
|
||||
UiThreadHandler.post {
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAP + TAG, "SmallMapView latLngList.size = ${latLngList.size} clearPolyline ---->")
|
||||
SceneConstant.M_MAP + TAG,
|
||||
"SmallMapView latLngList.size = ${latLngList.size} clearPolyline ---->"
|
||||
)
|
||||
clearPolyline()
|
||||
}
|
||||
}
|
||||
@@ -356,7 +360,8 @@ class SmallMapView @JvmOverloads constructor(
|
||||
|
||||
override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) {
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAP + TAG, "SmallMapView globalPathResp = $globalPathResp")
|
||||
SceneConstant.M_MAP + TAG, "SmallMapView globalPathResp = $globalPathResp"
|
||||
)
|
||||
if (globalPathResp == null || globalPathResp.wayPointsList.size == 0) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user