diff --git a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.kt b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.kt index d8cbb83458..df13122d1e 100644 --- a/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.kt +++ b/OCH/mogo-och-bus-passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/ui/BusPassengerMapDirectionView.kt @@ -41,7 +41,7 @@ class BusPassengerMapDirectionView @JvmOverloads constructor( companion object { //小地图名称 - const val TAG = "TPMapDirectionView" + const val TAG = "BusPassengerMapDirectionView" } private lateinit var mAMapNaviView: TextureMapView @@ -116,7 +116,7 @@ class BusPassengerMapDirectionView @JvmOverloads constructor( // 设置地图的样式 mAMap.uiSettings.apply { isZoomControlsEnabled = false // 地图缩放级别的交换按钮 - setAllGesturesEnabled(false) // 所有手势 + setAllGesturesEnabled(true) // 所有手势 isMyLocationButtonEnabled = false // 显示默认的定位按钮 setLogoBottomMargin(-150) //设置Logo下边界距离屏幕底部的边距,设置为负值即可 } @@ -148,9 +148,9 @@ class BusPassengerMapDirectionView @JvmOverloads constructor( mAMap.setOnCameraChangeListener(this) } - override fun onInterceptTouchEvent(ev: MotionEvent): Boolean { - return true - } +// override fun onInterceptTouchEvent(ev: MotionEvent): Boolean { +// return true +// } override fun onChassisLocationGCJ02(mogoLocation: MogoLocation?) { if (mogoLocation == null) { @@ -212,8 +212,10 @@ class BusPassengerMapDirectionView @JvmOverloads constructor( mPolyline!!.options.customTextureIndex = texIndexList return } - textureList.add(mArrivedRes) - textureList.add(mUnArrivedRes) + if(textureList.isEmpty()) { + textureList.add(mArrivedRes) + textureList.add(mUnArrivedRes) + } //设置线段纹理 val polylineOptions = PolylineOptions().apply { addAll(allPoints) @@ -231,6 +233,7 @@ class BusPassengerMapDirectionView @JvmOverloads constructor( override fun clearPolyline() { if (mPolyline != null) { mPolyline!!.remove() + mPolyline = null } } diff --git a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerMapDirectionView.kt b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerMapDirectionView.kt index f918dc1956..0536e8e49d 100644 --- a/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerMapDirectionView.kt +++ b/OCH/mogo-och-taxi-passenger/src/main/java/com/mogo/och/taxi/passenger/ui/TaxiPassengerMapDirectionView.kt @@ -42,7 +42,7 @@ class TaxiPassengerMapDirectionView @JvmOverloads constructor( companion object { //小地图名称 - const val TAG = "TPMapDirectionView" + const val TAG = "TaxiPassengerMapDirectionView" private const val zoomLevel = 13.0f } @@ -212,8 +212,10 @@ class TaxiPassengerMapDirectionView @JvmOverloads constructor( mPolyline!!.options.customTextureIndex = texIndexList return } - textureList.add(mArrivedRes) - textureList.add(mUnArrivedRes) + if(textureList.isEmpty()) { + textureList.add(mArrivedRes) + textureList.add(mUnArrivedRes) + } //设置线段纹理 val polylineOptions = PolylineOptions().apply { addAll(allPoints) @@ -231,6 +233,7 @@ class TaxiPassengerMapDirectionView @JvmOverloads constructor( override fun clearPolyline() { if (mPolyline != null) { mPolyline!!.remove() + mPolyline = null } mStartMarker.isVisible = false mEndMarker.isVisible = false diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.kt b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.kt index db83146586..5718ed6a16 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.kt +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/ui/TaxiMapDirectionView.kt @@ -219,8 +219,10 @@ class TaxiMapDirectionView @JvmOverloads constructor( mPolyline!!.options.customTextureIndex = texIndexList return } - textureList.add(mArrivedRes) - textureList.add(mUnArrivedRes) + if(textureList.isEmpty()) { + textureList.add(mArrivedRes) + textureList.add(mUnArrivedRes) + } //设置线段纹理 val polylineOptions = PolylineOptions().apply { addAll(allPoints) @@ -238,6 +240,7 @@ class TaxiMapDirectionView @JvmOverloads constructor( override fun clearPolyline() { if (mPolyline != null) { mPolyline!!.remove() + mPolyline = null } mStartMarker.isVisible = false mEndMarker.isVisible = false @@ -281,6 +284,6 @@ class TaxiMapDirectionView @JvmOverloads constructor( companion object { //小地图名称 - const val TAG = "TPMapDirectionView" + const val TAG = "TaxiMapDirectionView" } } \ No newline at end of file