This commit is contained in:
jiaguofeng
2020-08-18 15:09:18 +08:00
parent 5e07ab006d
commit 8a0b1a19cb

View File

@@ -5,7 +5,6 @@ import android.graphics.Point;
import android.graphics.Rect;
import android.location.Location;
import android.os.Bundle;
import android.os.SystemClock;
import android.os.Trace;
import android.util.Log;
import android.view.MotionEvent;
@@ -27,24 +26,19 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.MapCameraPosition;
import com.mogo.map.uicontroller.MapControlResult;
import com.mogo.utils.logger.Logger;
import com.zhidaoauto.map.sdk.inner.common.MapHelper;
import com.zhidaoauto.map.sdk.open.MapAutoApi;
import com.zhidaoauto.map.sdk.open.MapParams;
import com.zhidaoauto.map.sdk.open.abs.MapStatusListener;
import com.zhidaoauto.map.sdk.open.abs.OnCameraChangeListener;
import com.zhidaoauto.map.sdk.open.abs.OnMapClickListener;
import com.zhidaoauto.map.sdk.open.abs.OnMapLoadedListener;
import com.zhidaoauto.map.sdk.open.abs.OnMapTouchListener;
import com.zhidaoauto.map.sdk.open.camera.CameraPosition;
import com.zhidaoauto.map.sdk.open.camera.CameraUpdate;
import com.zhidaoauto.map.sdk.open.camera.CameraUpdateFactory;
import com.zhidaoauto.map.sdk.open.camera.LatLngBounds;
import com.zhidaoauto.map.sdk.open.camera.MapCameraMessage;
import com.zhidaoauto.map.sdk.open.location.LocationListener;
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle;
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory;
import com.zhidaoauto.map.sdk.open.marker.Marker;
import com.zhidaoauto.map.sdk.open.marker.MarkerInfo;
import com.zhidaoauto.map.sdk.open.query.LonLatPoint;
import com.zhidaoauto.map.sdk.open.tools.MapTools;
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
@@ -103,7 +97,7 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
// 设置指南针图标否在导航界面显示默认显示。true显示false隐藏。
options.hiddenDirection();
// 黑夜模式
options.setMapStyle(MapParams.MAP_STYLE_NIGHT);
options.setMapStyle(MapAutoApi.MAP_STYLE_NIGHT);
//设置路况光柱条是否显示(只适用于驾车导航,需要联网)。
// options.setTrafficBarEnabled( false );
// 设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。
@@ -143,7 +137,7 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
options.setZoom(((int) mDefaultZoomLevel));
// options.setPointToCenter( 0.5D, 0.5D );
// 2D模式
options.setMapViewPerspective(MapParams.MAP_PERSPECTIVE_2D);
options.setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_2D);
// mMapView.setViewOptions( options );
}
// mMapView.setRouteOverlayVisible( false );
@@ -206,7 +200,7 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
@Override
public void onResume() {
if (mMapView != null) {
mMapView.onResume();
// mMapView.onResume();
Logger.d(TAG, "map onResume");
}
}
@@ -303,11 +297,11 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
return;
case Type_Light:
mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
mMapView.getMapAutoViewHelper().setMapStyle(MapHelper.INSTANCE.getMMapParams().MAP_STYLE_DAY);
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_DAY);
break;
case Type_Night:
mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
mMapView.getMapAutoViewHelper().setMapStyle(MapHelper.INSTANCE.getMMapParams().MAP_STYLE_NIGHT);
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_NIGHT);
break;
case Type_AUTO_LIGHT_Night:
mMapView.getMapAutoViewHelper().setAutoSwitchStyle(true);
@@ -327,10 +321,10 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
if (mMapView.getMapAutoViewHelper() != null) {
switch (ui) {
case CarUp_2D:
mMapView.getMapAutoViewHelper().setMapViewPerspective(MapParams.MAP_PERSPECTIVE_2D);
mMapView.getMapAutoViewHelper().setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_2D);
break;
case CarUp_3D:
mMapView.getMapAutoViewHelper().setMapViewPerspective(MapParams.MAP_PERSPECTIVE_3D);
mMapView.getMapAutoViewHelper().setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_3D);
break;
case NorthUP_2D:
mMapView.getMapAutoViewHelper().setRotateGesturesEnabled(false);
@@ -486,7 +480,6 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
// Logger.d(TAG, Log.getStackTraceString(new Throwable()));
// }
Logger.d(TAG, "setPointToCenter(%s, %s)", mapCenterX, mapCenterY);
MapAutoApi.INSTANCE.getMapParams().setPointToCenter((float) mapCenterX, (float) mapCenterY);
mMapView.getMapAutoViewHelper().setPointToCenter((float) mapCenterX, (float) mapCenterY);
}
}