From 2670e77a1fab366588d54f0119cf6ec6b55a9655 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 29 Dec 2022 14:09:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[Fix]=E5=85=A8=E8=A7=88=E5=9C=B0=E5=9B=BEV2?= =?UTF-8?q?X=E6=95=B0=E6=8D=AE=E5=9D=90=E6=A0=87=E7=B3=BB=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../eagle/core/function/smp/AMapCustomView.java | 12 +----------- .../core/function/smp/MarkerDrawerManager.kt | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 11 deletions(-) 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..29073aea6e 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,8 +268,7 @@ 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.icon(BitmapDescriptorFactory.fromBitmap(getV2XBitmap())); markerOptionsList.add(markerOption); @@ -282,15 +281,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() { 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 From 4be31b5199efce050d6fbf1bc4dedeb0aa3528f1 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 29 Dec 2022 20:33:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[Update]=E8=B0=83=E6=95=B4=E9=81=93?= =?UTF-8?q?=E8=B7=AF=E6=96=BD=E5=B7=A5=E4=BA=8B=E4=BB=B6=E6=B0=94=E6=B3=A1?= =?UTF-8?q?=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mogo/eagle/core/function/smp/AMapCustomView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 29073aea6e..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 @@ -270,6 +270,7 @@ public class AMapCustomView MarkerOptions markerOption = new MarkerOptions(); 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); } @@ -320,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;