Merge branch 'dev_robotaxi-d-app-module_2130_221116_2.13.0' into 'test_robotaxi-d-app-module_2130_221116_2.13.0.1'

Dev robotaxi d app module 2130 221116 2.13.0

See merge request zhjt/AndroidApp/MoGoEagleEye!494
This commit is contained in:
chenfufeng
2022-12-29 12:39:04 +00:00
2 changed files with 18 additions and 12 deletions

View File

@@ -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<MarkerOptions> markerOptionsList) {
currMarkerList = mAMap.addMarkers(markerOptionsList, false);
mAMap.setOnMarkerClickListener(marker -> {
List<Infrastructure> 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;

View File

@@ -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()
}
}