This commit is contained in:
wangcongtao
2020-10-20 10:03:11 +08:00
parent 7cc699e251
commit 2ecf7d2a48
16 changed files with 184 additions and 116 deletions

View File

@@ -92,11 +92,13 @@ public class AMapNaviViewWrapper implements IMogoMapView,
.build();
private CarCursorOption mCarCursorOption = DEFAULT_OPTION;
private BnHooker bnHooker;
public AMapNaviViewWrapper( AMapNaviView mapView ) {
this.mMapView = mapView;
this.mIMap = new AMapWrapper( mMapView.getMap(), mMapView.getContext(), this );
try {
new BnHooker( mMapView.getMap(), mapView.getContext() );
bnHooker = new BnHooker( mMapView.getMap(), mapView.getContext() );
} catch ( Exception e ) {
e.printStackTrace();
}
@@ -279,6 +281,12 @@ public class AMapNaviViewWrapper implements IMogoMapView,
if ( motionEvent.getAction() == MotionEvent.ACTION_DOWN ) {
changeMyLocationType2UnFollow();
}
try {
bnHooker.print();
} catch ( Exception e ) {
e.printStackTrace();
}
}
/**
@@ -580,6 +588,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
if ( !checkAMapView() ) {
return;
}
MyLocationStyle style = getMyLocationStyle();
switch ( mCurrentUIMode ) {
case NorthUP_2D:
@@ -650,8 +659,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
}
Logger.d( TAG, "解锁锁车" );
mockTouchEvent();
mIsCarLocked = false;
mockTouchEvent();
}
/**
@@ -674,7 +683,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
}
Logger.d( TAG, "Zoom锁定锁车比例尺 %s", var1 );
mMapView.setLockZoom( var1 );
// mMapView.setLockZoom( var1 );
}
}

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import com.amap.api.maps.AMap;
import com.autonavi.amap.mapcore.interfaces.IAMap;
import com.autonavi.base.ae.gmap.GLMapEngine;
import com.autonavi.base.amap.api.mapcore.IAMapDelegate;
import com.autonavi.base.amap.mapcore.interfaces.IAMapListener;
import com.mogo.map.impl.amap.navi.NaviClient;
@@ -13,6 +14,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.List;
/**
* @author congtaowang
@@ -48,6 +50,19 @@ public class BnHooker implements InvocationHandler {
this
);
field.set( map, object );
}
public void print() throws Exception {
Method method = host.getClass().getDeclaredMethod( "getGLMapEngine" );
method.setAccessible( true );
GLMapEngine glMapEngine = ( GLMapEngine ) method.invoke( host );
glMapEngine.clearAllMessages( 0 );
Field stateMessageListField = glMapEngine.getClass().getDeclaredField( "mStateMessageList" );
stateMessageListField.setAccessible( true );
List valList = ( List ) stateMessageListField.get( glMapEngine );
valList.clear();
}
@Override