[6.5.0][视角切换] 优化高精地图控件手势禁用和开启逻辑
This commit is contained in:
@@ -76,7 +76,7 @@ class VisualViewModel : ViewModel(),
|
||||
|
||||
when (angle) {
|
||||
Visualangle.Middle -> {
|
||||
CallerVisualAngleManager.changeScene(Default())
|
||||
CallerVisualAngleManager.changeScene(Default(forceClosePrev = true))
|
||||
}
|
||||
|
||||
Visualangle.Long -> {
|
||||
|
||||
@@ -139,6 +139,8 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
private var waitTime = 5000L
|
||||
private var isAutoLockCar = true
|
||||
|
||||
private var isAllGestureEnabled = true
|
||||
|
||||
// 协程
|
||||
private val mScope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
|
||||
// 耗时专用协程
|
||||
@@ -336,6 +338,9 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
|
||||
var lonlat: LonLat? = null
|
||||
override fun onTouchEvent(ev: MotionEvent): Boolean {
|
||||
if (!isAllGestureEnabled) {
|
||||
return mGestureDetector.onTouchEvent(ev)
|
||||
}
|
||||
if (ev.action == MotionEvent.ACTION_MOVE && mDragMarker != null) {
|
||||
mDragMarker?.let {
|
||||
if(DEBUG){
|
||||
@@ -993,6 +998,9 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
if (DEBUG && mShowTouchInfo) {
|
||||
Log.i(TAG, "touchop--mGestureDetector--onFling:e1:${e1.x},${e1.y},e2:${e2.x},${e2.y},${velocityX},${velocityY}")
|
||||
}
|
||||
if (!isAllGestureEnabled) {
|
||||
return false
|
||||
}
|
||||
if (e1.pointerCount >= 2 || e2.pointerCount >= 2) {
|
||||
return false
|
||||
}
|
||||
@@ -1040,6 +1048,10 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
if (DEBUG && mShowTouchInfo) {
|
||||
Log.i(TAG, "touchop--mGestureDetector--onScroll:e1:${e1.pointerCount},${e1.x},${e1.y},,e2:${e2.pointerCount},${e2.x},${e2.y},$distanceX,$distanceY,time:${e2.eventTime}")
|
||||
}
|
||||
|
||||
if (!isAllGestureEnabled) {
|
||||
return false
|
||||
}
|
||||
if (e1.pointerCount >= 2 || e2.pointerCount >= 2) {
|
||||
return false
|
||||
}
|
||||
@@ -1256,6 +1268,10 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
this.renderTimePer = renderTimePer
|
||||
}
|
||||
|
||||
override fun setAllGestureEnabled(flag: Boolean) {
|
||||
this.isAllGestureEnabled = flag
|
||||
}
|
||||
|
||||
private fun renderDataCallback(data: String) {
|
||||
// if(DEBUG){
|
||||
// Log.d("renderDataCallback", "renderDataCallback:$data")
|
||||
|
||||
@@ -478,4 +478,6 @@ interface IMapController {
|
||||
fun setStreetLightEffectIsEnable(isEnable: Boolean)
|
||||
|
||||
fun setHDTypeVisible(type: IntArray?)
|
||||
|
||||
fun setAllGestureEnabled(flag: Boolean)
|
||||
}
|
||||
@@ -80,37 +80,11 @@ interface IMapView {
|
||||
//耗时协程
|
||||
fun getDemaningScope():CoroutineScope?
|
||||
|
||||
// 设置手势标记位-- 临时
|
||||
fun setAllGestureEnabled(flag: Boolean)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// fun setIsFarViewAngel(isFar: Boolean)
|
||||
// fun setIsFarViewAngel(isFar: Boolean)
|
||||
//
|
||||
// fun setUpdateCount(updateCount: Int)
|
||||
}
|
||||
@@ -2281,4 +2281,8 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
override fun setHDTypeVisible(type: IntArray?){
|
||||
mMapView.getMapEngine().setHDTypeVisible(type)
|
||||
}
|
||||
|
||||
override fun setAllGestureEnabled(flag: Boolean) {
|
||||
mMapView.setAllGestureEnabled(flag)
|
||||
}
|
||||
}
|
||||
@@ -550,6 +550,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
|
||||
mMapAutoView.getMapController()?.setScroll(flag)
|
||||
mMapAutoView.getMapController()?.setFling(flag)
|
||||
mMapAutoView.getMapController()?.setRotate(flag)
|
||||
mMapAutoView.getMapController()?.setAllGestureEnabled(flag)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user