diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java index a6c8f73d09..2f722c5df4 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java @@ -268,9 +268,9 @@ public class AMapCustomView if (center != null) { center.getLon(); MarkerOptions markerOption = new MarkerOptions(); - LatLng latLng = new LatLng(center.getLat(), - center.getLon()); + LatLng latLng = MarkerDrawerManager.INSTANCE.coordinateConverterWgsToGcj(mContext, center.getLat(), center.getLon()); markerOption.position(latLng); + markerOption.anchor(0.13f, 1f); markerOption.icon(BitmapDescriptorFactory.fromBitmap(getV2XBitmap())); markerOptionsList.add(markerOption); } @@ -282,15 +282,6 @@ public class AMapCustomView public void drawV2XMarkers(ArrayList markerOptionsList) { currMarkerList = mAMap.addMarkers(markerOptionsList, false); - mAMap.setOnMarkerClickListener(marker -> { - List infList = posInfMap.get(marker.getPosition()); - // 如果是摄像头 - if (infList != null) { - CallerHmiManager.INSTANCE.showVideoDialog(infList); - return true; - } - return false; - }); } private Bitmap getV2XBitmap() { @@ -330,7 +321,7 @@ public class AMapCustomView public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from, boolean isGps) { mLocation = location; MarkerDrawerManager.INSTANCE.setLonLat(new Pair(location.getLongitude(), location.getLatitude())); - drawCarMarker(location); +// drawCarMarker(location); if (isFirstLocation) { displayCustomOverView(); isFirstLocation = false; diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/MarkerDrawerManager.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/MarkerDrawerManager.kt index 0ab43a4063..9ce14cf8ba 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/MarkerDrawerManager.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/MarkerDrawerManager.kt @@ -161,4 +161,19 @@ object MarkerDrawerManager { mCoordinateConverter.coord(LatLng(mogoLatLng.latitude, mogoLatLng.longitude)) return mCoordinateConverter.convert() } + + /** + * wgs84转高德坐标系 + */ + fun coordinateConverterWgsToGcj( + mContext: Context, + lat: Double, + lon: Double + ): LatLng { + val mCoordinateConverter = + CoordinateConverter(mContext) + mCoordinateConverter.from(CoordinateConverter.CoordType.GPS) + mCoordinateConverter.coord(LatLng(lat, lon)) + return mCoordinateConverter.convert() + } } \ No newline at end of file