balabala~~~
This commit is contained in:
@@ -55,7 +55,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-online-27'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-online-30'
|
||||
}
|
||||
|
||||
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()
|
||||
|
||||
@@ -97,7 +97,6 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
|
||||
// options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() );
|
||||
// 设置自车的图片对象
|
||||
options.setMyLocationStyle( options.getMyLocationStyle().myLocationIcon( DEFAULT_OPTION.getCarCursorRes() ) );
|
||||
options.setAnchorScale(1.2f, 2 );
|
||||
// 设置指南针图标否在导航界面显示,默认显示。true,显示;false,隐藏。
|
||||
// options.hiddenDirection();
|
||||
// 黑夜模式
|
||||
@@ -486,8 +485,8 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
|
||||
// if (DebugConfig.isDebug()) {
|
||||
// Logger.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||
// }
|
||||
Logger.d( TAG, "setPointToCenter(%s, %s)", mapCenterX, mapCenterY );
|
||||
mMapView.getMapAutoViewHelper().setPointToCenter( ( float ) mapCenterX, ( float ) mapCenterY );
|
||||
// Logger.d( TAG, "setPointToCenter(%s, %s)", mapCenterX, mapCenterY );
|
||||
// mMapView.getMapAutoViewHelper().setPointToCenter( ( float ) mapCenterX, ( float ) mapCenterY );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -671,7 +670,6 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
|
||||
MogoMapListenerHandler.getInstance().onMapClick( ObjectUtils.fromAMap( lonLatPoint ) );
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
Logger.i( TAG, "autoop--onMapLoaded: " );
|
||||
@@ -686,6 +684,8 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
|
||||
Trace.endSection();
|
||||
}
|
||||
|
||||
getMap().getUIController().setAnchorRate( 0.01f );
|
||||
getMap().getUIController().setAnchorScale( 1.2f, 2.7f );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -726,4 +726,14 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
|
||||
Trace.endSection();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAnchorScale( float x, float y ) {
|
||||
mMapView.getMapAutoViewHelper().setAnchorScale( x, y );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAnchorRate( float rate ) {
|
||||
mMapView.getMapAutoViewHelper().setAnchorRate( rate );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class CustomMapView implements IMogoMapViewCreator {
|
||||
.setCoordinateType( MapParams.COORDINATETYPE_GCJ02 )
|
||||
.setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D )
|
||||
.setZoom( 16 )
|
||||
.setPointToCenter( 0.5f, 0.5f )
|
||||
.setPointToCenter( 0.5f, 0.8f )
|
||||
.setStyleMode( MapParams.MAP_STYLE_VR ) );
|
||||
}
|
||||
MapAutoView mapAutoView = new MapAutoView( context );
|
||||
|
||||
@@ -276,4 +276,9 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
mClient.changeBearing( bearing );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAnchorScale( float x, float y ) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ public interface IMogoMapUIController {
|
||||
/**
|
||||
* 将地图移动至当前位置
|
||||
*/
|
||||
default void moveToCenter( MogoLatLng latLng ){
|
||||
moveToCenter(latLng, false);
|
||||
default void moveToCenter( MogoLatLng latLng ) {
|
||||
moveToCenter( latLng, false );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,7 +220,16 @@ public interface IMogoMapUIController {
|
||||
|
||||
/**
|
||||
* 切换地图视图视角
|
||||
*
|
||||
* @param bearing
|
||||
*/
|
||||
void changeBearing(float bearing);
|
||||
void changeBearing( float bearing );
|
||||
|
||||
default void setAnchorScale( float x, float y ) {
|
||||
|
||||
}
|
||||
|
||||
default void setAnchorRate( float rate ) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,18 +41,10 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
@Override
|
||||
protected void addDleMaps() {
|
||||
|
||||
mCustomMapView = new CustomMapView().create( getContext() );
|
||||
if ( mCustomMapView != null ) {
|
||||
final View mapView = mCustomMapView.getMapView();
|
||||
if ( mapView != null ) {
|
||||
addView( mapView, new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) );
|
||||
} else {
|
||||
Logger.e( TAG, "create MapView instance failed." );
|
||||
}
|
||||
} else {
|
||||
Logger.e( TAG, "create IMogoMapView instance failed." );
|
||||
}
|
||||
display2DMap( true, true );
|
||||
}
|
||||
|
||||
private void addAMapView(){
|
||||
mAMapView = new AMapBaseMapView().create( getContext() );
|
||||
if ( mAMapView != null ) {
|
||||
final View mapView = mAMapView.getMapView();
|
||||
@@ -64,42 +56,68 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
} else {
|
||||
Logger.e( TAG, "create IMogoMapView instance failed." );
|
||||
}
|
||||
mMapView = mAMapView;
|
||||
}
|
||||
|
||||
mCustomMapView.getMapView().setVisibility( View.GONE );
|
||||
private void addVrMapView(){
|
||||
mCustomMapView = new CustomMapView().create( getContext() );
|
||||
if ( mCustomMapView != null ) {
|
||||
final View mapView = mCustomMapView.getMapView();
|
||||
if ( mapView != null ) {
|
||||
addView( mapView, new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) );
|
||||
} else {
|
||||
Logger.e( TAG, "create MapView instance failed." );
|
||||
}
|
||||
} else {
|
||||
Logger.e( TAG, "create IMogoMapView instance failed." );
|
||||
}
|
||||
mCustomMapView.onCreate( null );
|
||||
}
|
||||
|
||||
MogoMap.getInstance().init( getContext(), mMapView.getMap() );
|
||||
private void removeVrMapView(){
|
||||
try {
|
||||
mCustomMapView.onDestroy();
|
||||
removeView( mCustomMapView.getMapView() );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void removeAMapView(){
|
||||
try {
|
||||
mAMapView.onPause();
|
||||
removeView( mAMapView.getMapView() );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void display2DMap( boolean invokeCreateAuto, boolean invokeResumeAuto ) {
|
||||
mIsVrMode = false;
|
||||
mMapView = mAMapView;
|
||||
MogoMarkerManager.getInstance( getContext() ).removeMarkers();
|
||||
MogoMap.getInstance().init( getContext(), mAMapView.getMap() );
|
||||
removeVrMapView();
|
||||
addAMapView();
|
||||
mMapView = mAMapView;
|
||||
MogoMap.getInstance().init( getContext(), mMapView.getMap() );
|
||||
MogoMapUIController.getInstance().setDelegate( AMapUIController.getInstance() );
|
||||
mCustomMapView.onPause();
|
||||
mCustomMapView.getMapView().setVisibility( View.GONE );
|
||||
mAMapView.onResume();
|
||||
mAMapView.getMapView().setVisibility( View.VISIBLE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayVRMap( boolean invokeCreateAuto, boolean invokeResumeAuto ) {
|
||||
mIsVrMode = true;
|
||||
mMapView = mCustomMapView;
|
||||
MogoMarkerManager.getInstance( getContext() ).removeMarkers();
|
||||
MogoMap.getInstance().init( getContext(), mCustomMapView.getMap() );
|
||||
removeAMapView();
|
||||
addVrMapView();
|
||||
mMapView = mCustomMapView;
|
||||
MogoMap.getInstance().init( getContext(), mMapView.getMap() );
|
||||
MogoMapUIController.getInstance().setDelegate( com.mogo.map.impl.custom.uicontroller.AMapUIController.getInstance() );
|
||||
mCustomMapView.onResume();
|
||||
mCustomMapView.getMapView().setVisibility( View.VISIBLE );
|
||||
mAMapView.onPause();
|
||||
mAMapView.getMapView().setVisibility( View.GONE );
|
||||
post( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
mAMapView.getMap().getUIController().showMyLocation( true );
|
||||
getMap().getUIController().showMyLocation( true );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user