[6.7.0][Feat]高德地图增加圆角

This commit is contained in:
chenfufeng
2024-09-23 18:37:39 +08:00
parent ce926a6412
commit cacf43cb05
5 changed files with 31 additions and 9 deletions

View File

@@ -398,8 +398,8 @@
<com.mogo.eagle.core.function.hmi.map.MapContainerLayout
android:id="@+id/mapContainerLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="1560dp"
android:layout_height="1534dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>

View File

@@ -134,8 +134,8 @@ class ExchangeChildLayout @JvmOverloads constructor(
txPro = PropertyValuesHolder.ofFloat("translationX", 0f, bottomX - topX - minWidth * (1 - tScaleX) / 2)
tyPro = PropertyValuesHolder.ofFloat("translationY", 0f, bottomY - topY - minHeight * (1 - tScaleY) / 2)
tWidthPro = PropertyValuesHolder.ofFloat("scaleX", 1f, tScaleX/1.5f)
tHeightPro = PropertyValuesHolder.ofFloat("scaleY", 1f, tScaleY/1.5f)
tWidthPro = PropertyValuesHolder.ofFloat("scaleX", 1f, tScaleX/2f)
tHeightPro = PropertyValuesHolder.ofFloat("scaleY", 1f, tScaleY/2f)
alphaPro = PropertyValuesHolder.ofFloat("alpha", 1f, 0.1f)
tOA = ObjectAnimator.ofPropertyValuesHolder(topView, tWidthPro, tHeightPro, txPro, tyPro, alphaPro)
} else {
@@ -147,8 +147,8 @@ class ExchangeChildLayout @JvmOverloads constructor(
txPro = PropertyValuesHolder.ofFloat("translationX", 0f, bottomX - topX - minWidth * (1 - tScaleX) / 2)
tyPro = PropertyValuesHolder.ofFloat("translationY", 0f, bottomY - topY - minHeight * (1 - tScaleY) / 2)
tWidthPro = PropertyValuesHolder.ofFloat("scaleX", 1f, tScaleX/1.5f)
tHeightPro = PropertyValuesHolder.ofFloat("scaleY", 1f, tScaleY/1.5f)
tWidthPro = PropertyValuesHolder.ofFloat("scaleX", 1f, tScaleX/2f)
tHeightPro = PropertyValuesHolder.ofFloat("scaleY", 1f, tScaleY/2f)
alphaPro = PropertyValuesHolder.ofFloat("alpha", 1f, 0.1f)
tOA = ObjectAnimator.ofPropertyValuesHolder(bottomView, tWidthPro, tHeightPro, txPro, tyPro, alphaPro)

View File

@@ -81,6 +81,7 @@ class MapContainerLayout @JvmOverloads constructor(
overMapView.setOnGestureListener(object : TravelRealityView.OnGestureListener {
override fun onSingleTap(lng: Float, lat: Float) {
if (!exchangeLayout.getSwapFlag()) {
overMapView.setMapFlag(false)
exchangeLayout.swapViews()
}
}
@@ -90,6 +91,7 @@ class MapContainerLayout @JvmOverloads constructor(
override fun onMapClick(latLng: MogoLatLng?) {
super.onMapClick(latLng)
if (exchangeLayout.getSwapFlag()) {
overMapView.setMapFlag(true)
exchangeLayout.swapViews()
}
}

View File

@@ -2,8 +2,8 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="1560dp"
android:layout_height="1534dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="MissingDefaultResource">
<com.mogo.eagle.core.function.hmi.map.ExchangeChildLayout

View File

@@ -29,6 +29,7 @@ import com.amap.api.maps.model.Marker
import com.amap.api.maps.model.MarkerOptions
import com.amap.api.maps.model.Polyline
import com.amap.api.maps.model.PolylineOptions
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
@@ -41,13 +42,14 @@ import com.mogo.eagle.core.function.business.travelreality.Point
import com.mogo.eagle.core.function.business.travelreality.TravelRealityModel.Companion.travelNetWorkModel
import com.mogo.eagle.core.function.business.travelreality.view.EventVideoView
import com.mogo.eagle.core.function.business.travelreality.view.VideoMarkerEntity
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.map.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils
import com.mogo.eagle.core.utilcode.util.LocationUtils
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
import me.jessyan.autosize.utils.AutoSizeUtils
import mogo.telematics.pad.MessagePad
@@ -207,6 +209,7 @@ class TravelRealityView @JvmOverloads constructor(
private var listener: OnDrawListener? = null
private var gestureListener: OnGestureListener? = null
private var isSmallMap: Boolean = true
init {
try {
@@ -278,6 +281,10 @@ class TravelRealityView @JvmOverloads constructor(
this.gestureListener = listener
}
fun setMapFlag(isSmallMap: Boolean) {
this.isSmallMap = isSmallMap
}
/**
* 清除所有Marker和Polyline
*/
@@ -400,6 +407,19 @@ class TravelRealityView @JvmOverloads constructor(
})
}
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
super.onSizeChanged(w, h, oldw, oldh)
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
if (isSmallMap) {
this.outlineProvider = TextureVideoViewOutlineProvider(AutoSizeUtils.dp2px(context, 32f)
.toFloat())
this.clipToOutline = true
} else {
this.clipToOutline = false
}
}
}
override fun onVisibilityChanged(changedView: View, visibility: Int) {
super.onVisibilityChanged(changedView, visibility)
if (visibility == VISIBLE) {