[2.13.0]更新全览地图V2X事件气泡的样式
This commit is contained in:
@@ -54,6 +54,7 @@ import java.util.Map;
|
||||
|
||||
import ch.hsr.geohash.GeoHash;
|
||||
import kotlin.Pair;
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
@@ -270,7 +271,7 @@ public class AMapCustomView
|
||||
LatLng latLng = new LatLng(center.getLat(),
|
||||
center.getLon());
|
||||
markerOption.position(latLng);
|
||||
markerOption.icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_small_v2x_road_construction));
|
||||
markerOption.icon(BitmapDescriptorFactory.fromBitmap(getV2XBitmap()));
|
||||
markerOptionsList.add(markerOption);
|
||||
}
|
||||
}
|
||||
@@ -292,6 +293,16 @@ public class AMapCustomView
|
||||
});
|
||||
}
|
||||
|
||||
private Bitmap getV2XBitmap() {
|
||||
V2XMarkerView marker = new V2XMarkerView(getContext());
|
||||
marker.measure(View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(mContext, 229), View.MeasureSpec.EXACTLY),
|
||||
View.MeasureSpec.makeMeasureSpec(AutoSizeUtils.dp2px(mContext, 96), View.MeasureSpec.EXACTLY));
|
||||
marker.layout(0, 0, marker.getMeasuredWidth(), marker.getMeasuredHeight());
|
||||
Bitmap bitmap = Bitmap.createBitmap(marker.getWidth(), marker.getHeight(), Bitmap.Config.ARGB_8888);
|
||||
marker.draw(new Canvas(bitmap));
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
public void clearV2XMarkers() {
|
||||
if (currMarkerList != null) {
|
||||
for (Marker marker : currMarkerList) {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.mogo.eagle.core.function.smp
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.map.R
|
||||
import kotlinx.android.synthetic.main.view_maker_with_count.view.*
|
||||
|
||||
class V2XMarkerView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout (
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_v2x_maker, this, true)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="229dp"
|
||||
android:layout_height="96dp"
|
||||
android:background="@drawable/icon_v2x_marker"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivIcon"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="11dp"
|
||||
android:background="@drawable/icon_small_v2x_road_construction"
|
||||
android:visibility="visible"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv"
|
||||
android:layout_width="119dp"
|
||||
android:layout_height="35dp"
|
||||
android:text="道路施工"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="23dp"
|
||||
android:layout_marginEnd="23dp"
|
||||
android:textColor="@color/white"
|
||||
android:gravity="center"
|
||||
android:textSize="29dp"
|
||||
tools:text="道路施工"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user