bugfix: UI-393

This commit is contained in:
wangcongtao
2020-03-02 17:53:48 +08:00
parent fe46c48447
commit 85d0aae48b
5 changed files with 43 additions and 18 deletions

View File

@@ -441,6 +441,10 @@ public class AMapNaviViewWrapper implements IMogoMapView,
if ( checkAMapView() ) {
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
style.showMyLocation( visible );
if ( visible ) {
// 强制刷新一遍车标
style.myLocationIcon( BitmapDescriptorFactory.fromResource( R.drawable.map_api_ic_current_location2 ) );
}
mMapView.getMap().setMyLocationStyle( style );
}
}
@@ -455,8 +459,6 @@ public class AMapNaviViewWrapper implements IMogoMapView,
style.strokeColor( Color.TRANSPARENT );
style.strokeWidth( 0 );
style.radiusFillColor( Color.TRANSPARENT );
style.myLocationIcon(
BitmapDescriptorFactory.fromResource( R.drawable.map_api_ic_current_location2 ) );
mMapView.getMap().setMyLocationStyle( style );
}
}
@@ -670,4 +672,11 @@ public class AMapNaviViewWrapper implements IMogoMapView,
}
}
}
@Override
public void forceRender() {
if ( checkAMapView() ) {
mMapView.getMap().runOnDrawFrame();
}
}
}

View File

@@ -194,4 +194,11 @@ public class AMapUIController implements IMogoMapUIController {
mClient.showBounds( lonLats, bound );
}
}
@Override
public void forceRender() {
if ( mClient != null ) {
mClient.forceRender();
}
}
}

View File

@@ -155,4 +155,9 @@ public interface IMogoMapUIController {
* @param bound 地图上可显示的范围
*/
void showBounds( List< MogoLatLng > lonLats, Rect bound );
/**
* 强制刷新地图
*/
void forceRender();
}

View File

@@ -187,4 +187,11 @@ public class MogoMapUIController implements IMogoMapUIController {
mDelegate.showBounds( lonLats, bound );
}
}
@Override
public void forceRender() {
if ( mDelegate != null ) {
mDelegate.forceRender();
}
}
}

View File

@@ -61,22 +61,22 @@ public class MogoServices implements IMogoMapListener,
IMogoNaviListener,
IMogoStatusChangedListener,
IMogoIntentListener {
private MogoServices(){
private MogoServices() {
// private constructor
}
private static final class InstanceHolder{
private static final MogoServices INSTANCE = new MogoServices();
private static final class InstanceHolder {
private static final MogoServices INSTANCE = new MogoServices();
}
public static MogoServices getInstance(){
return InstanceHolder.INSTANCE;
public static MogoServices getInstance() {
return InstanceHolder.INSTANCE;
}
private Object readResolve(){
// 阻止反序列化,必须实现 Serializable 接口
return InstanceHolder.INSTANCE;
private Object readResolve() {
// 阻止反序列化,必须实现 Serializable 接口
return InstanceHolder.INSTANCE;
}
private static final String TAG = "MogoServices";
@@ -622,12 +622,9 @@ public class MogoServices implements IMogoMapListener,
return;
}
int status = intent.getIntExtra( MogoReceiver.PARAM_ADAS_STATUS, 0 );
if (status == 1 ){
MarkerServiceHandler.getMapUIController().setLockZoom(15);
}else{
MarkerServiceHandler.getMapUIController().setLockZoom(16);
}
mUiController.setLockZoom( status == 1 ? 15 : 16 );
mStatusManager.setADASUIShow( ServiceConst.TYPE, status == 1 );
mUiController.showMyLocation( true );
} else if ( Intent.ACTION_POWER_CONNECTED.equals( command ) ) {
mStatusManager.setAccStatus( ServiceConst.TYPE, true );
} else if ( Intent.ACTION_POWER_DISCONNECTED.equals( command ) ) {