[5.2.9]
[shuttle_p] [防止修改list]
This commit is contained in:
@@ -193,42 +193,46 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
|
||||
d(SceneConstant.M_TAXI + TAG, "没有点")
|
||||
return
|
||||
}
|
||||
texIndexList.clear()
|
||||
val allPoints = ArrayList(routeArrived)
|
||||
for (i in routeArrived.indices) {
|
||||
if (routeArrived.size > 1 && i < routeArrived.size - 1) {
|
||||
texIndexList.add(0)
|
||||
try {
|
||||
texIndexList.clear()
|
||||
val allPoints = ArrayList(routeArrived)
|
||||
for (i in routeArrived.indices) {
|
||||
if (routeArrived.size > 1 && i < routeArrived.size - 1) {
|
||||
texIndexList.add(0)
|
||||
}
|
||||
}
|
||||
texIndexList.add(0)
|
||||
location?.let {
|
||||
allPoints.add(LatLng(it.latitude, it.longitude))
|
||||
}
|
||||
allPoints.addAll(routeArriving)
|
||||
for (ignored in routeArrived) {
|
||||
texIndexList.add(1)
|
||||
}
|
||||
mPolyline?.let {
|
||||
it.points = allPoints
|
||||
it.options.customTextureIndex = texIndexList
|
||||
return
|
||||
}
|
||||
if(textureList.isEmpty()) {
|
||||
textureList.add(mArrivedRes)
|
||||
textureList.add(mUnArrivedRes)
|
||||
}
|
||||
//设置线段纹理
|
||||
val polylineOptions = PolylineOptions().apply {
|
||||
addAll(allPoints)
|
||||
isUseTexture = true
|
||||
width(15f)
|
||||
lineCapType(PolylineOptions.LineCapType.LineCapRound)
|
||||
customTextureList = textureList
|
||||
customTextureIndex = texIndexList
|
||||
}
|
||||
}
|
||||
texIndexList.add(0)
|
||||
location?.let {
|
||||
allPoints.add(LatLng(it.latitude, it.longitude))
|
||||
}
|
||||
allPoints.addAll(routeArriving)
|
||||
for (ignored in routeArrived) {
|
||||
texIndexList.add(1)
|
||||
}
|
||||
mPolyline?.let {
|
||||
it.points = allPoints
|
||||
it.options.customTextureIndex = texIndexList
|
||||
return
|
||||
}
|
||||
if(textureList.isEmpty()) {
|
||||
textureList.add(mArrivedRes)
|
||||
textureList.add(mUnArrivedRes)
|
||||
}
|
||||
//设置线段纹理
|
||||
val polylineOptions = PolylineOptions().apply {
|
||||
addAll(allPoints)
|
||||
isUseTexture = true
|
||||
width(15f)
|
||||
lineCapType(PolylineOptions.LineCapType.LineCapRound)
|
||||
customTextureList = textureList
|
||||
customTextureIndex = texIndexList
|
||||
}
|
||||
|
||||
// 绘制线
|
||||
mPolyline = mAMap.addPolyline(polylineOptions)
|
||||
// 绘制线
|
||||
mPolyline = mAMap.addPolyline(polylineOptions)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun clearPolyline() {
|
||||
|
||||
@@ -210,42 +210,46 @@ class BusPassengerMapDirectionView @JvmOverloads constructor(
|
||||
d(SceneConstant.M_TAXI + TAG, "没有点")
|
||||
return
|
||||
}
|
||||
texIndexList.clear()
|
||||
val allPoints = ArrayList(routeArrived)
|
||||
for (i in routeArrived.indices) {
|
||||
if (routeArrived.size > 1 && i < routeArrived.size - 1) {
|
||||
texIndexList.add(0)
|
||||
try {
|
||||
texIndexList.clear()
|
||||
val allPoints = ArrayList(routeArrived)
|
||||
for (i in routeArrived.indices) {
|
||||
if (routeArrived.size > 1 && i < routeArrived.size - 1) {
|
||||
texIndexList.add(0)
|
||||
}
|
||||
}
|
||||
texIndexList.add(0)
|
||||
location?.let {
|
||||
allPoints.add(LatLng(it.latitude, it.longitude))
|
||||
}
|
||||
allPoints.addAll(routeArriving)
|
||||
for (ignored in routeArrived) {
|
||||
texIndexList.add(1)
|
||||
}
|
||||
mPolyline?.let {
|
||||
it.points = allPoints
|
||||
it.options.customTextureIndex = texIndexList
|
||||
return
|
||||
}
|
||||
if (textureList.isEmpty()) {
|
||||
textureList.add(mArrivedRes)
|
||||
textureList.add(mUnArrivedRes)
|
||||
}
|
||||
//设置线段纹理
|
||||
val polylineOptions = PolylineOptions().apply {
|
||||
addAll(allPoints)
|
||||
isUseTexture = true
|
||||
width(15f)
|
||||
lineCapType(PolylineOptions.LineCapType.LineCapRound)
|
||||
customTextureList = textureList
|
||||
customTextureIndex = texIndexList
|
||||
}
|
||||
}
|
||||
texIndexList.add(0)
|
||||
location?.let {
|
||||
allPoints.add(LatLng(it.latitude, it.longitude))
|
||||
}
|
||||
allPoints.addAll(routeArriving)
|
||||
for (ignored in routeArrived) {
|
||||
texIndexList.add(1)
|
||||
}
|
||||
mPolyline?.let {
|
||||
it.points = allPoints
|
||||
it.options.customTextureIndex = texIndexList
|
||||
return
|
||||
}
|
||||
if (textureList.isEmpty()) {
|
||||
textureList.add(mArrivedRes)
|
||||
textureList.add(mUnArrivedRes)
|
||||
}
|
||||
//设置线段纹理
|
||||
val polylineOptions = PolylineOptions().apply {
|
||||
addAll(allPoints)
|
||||
isUseTexture = true
|
||||
width(15f)
|
||||
lineCapType(PolylineOptions.LineCapType.LineCapRound)
|
||||
customTextureList = textureList
|
||||
customTextureIndex = texIndexList
|
||||
}
|
||||
|
||||
// 绘制线
|
||||
mPolyline = mAMap.addPolyline(polylineOptions)
|
||||
// 绘制线
|
||||
mPolyline = mAMap.addPolyline(polylineOptions)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun clearPolyline() {
|
||||
|
||||
Reference in New Issue
Block a user