opt
This commit is contained in:
@@ -605,7 +605,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
if ( checkAMapView() ) {
|
||||
if ( NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
loseLockMode();
|
||||
NaviClient.getInstance( getContext() ).displayOverview(bounds);
|
||||
NaviClient.getInstance( getContext() ).displayOverview( bounds );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -824,12 +824,16 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void setCarCursorOption( CarCursorOption option ) {
|
||||
if ( mCarCursorOption != null ) {
|
||||
if ( mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION ) {
|
||||
mCarCursorOption.destroy();
|
||||
}
|
||||
try {
|
||||
mCarCursorOption = option.clone();
|
||||
} catch ( CloneNotSupportedException e ) {
|
||||
if ( option != null ) {
|
||||
try {
|
||||
mCarCursorOption = option.clone();
|
||||
} catch ( Exception e ) {
|
||||
mCarCursorOption = DEFAULT_OPTION;
|
||||
}
|
||||
} else {
|
||||
mCarCursorOption = DEFAULT_OPTION;
|
||||
}
|
||||
if ( !checkAMapView() ) {
|
||||
@@ -838,8 +842,10 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
AMapNaviViewOptions options = mMapView.getViewOptions();
|
||||
if ( options != null && mCarCursorOption.getNaviCursorRes() != 0 ) {
|
||||
options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), mCarCursorOption.getNaviCursorRes() ) );
|
||||
mMapView.setViewOptions( options );
|
||||
} else {
|
||||
options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), DEFAULT_OPTION.getNaviCursorRes() ) );
|
||||
}
|
||||
mMapView.setViewOptions( options );
|
||||
|
||||
if ( mMapView.getMap() == null ) {
|
||||
return;
|
||||
@@ -850,6 +856,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
} else {
|
||||
if ( mCarCursorOption.getCarCursorRes() != 0 ) {
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) );
|
||||
} else {
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromResource( DEFAULT_OPTION.getCarCursorRes() ) );
|
||||
}
|
||||
}
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
@@ -194,7 +195,7 @@ public interface IMogoMapUIController {
|
||||
/**
|
||||
* 配置自车图标样式
|
||||
*
|
||||
* @param option
|
||||
* @param option 为空时使用默认配置
|
||||
*/
|
||||
void setCarCursorOption( CarCursorOption option );
|
||||
void setCarCursorOption( @Nullable CarCursorOption option );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user