fix: bugly#11002
This commit is contained in:
@@ -522,7 +522,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
if ( checkAMapView() ) {
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
MyLocationStyle style = getMyLocationStyle();
|
||||
if ( style == null ) {
|
||||
style = new MyLocationStyle();
|
||||
}
|
||||
@@ -544,7 +544,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
if ( checkAMapView() ) {
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
MyLocationStyle style = getMyLocationStyle();
|
||||
if ( style == null ) {
|
||||
style = new MyLocationStyle();
|
||||
}
|
||||
@@ -557,7 +557,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
public void initMyLocation() {
|
||||
if ( checkAMapView() ) {
|
||||
mMapView.getMap().setMyLocationEnabled( true );
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
MyLocationStyle style = getMyLocationStyle();
|
||||
style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER );
|
||||
style.interval( 1000 );
|
||||
style.anchor( 0.5F, 0.5F );
|
||||
@@ -864,7 +864,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
if ( mMapView.getMap() == null ) {
|
||||
return;
|
||||
}
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
MyLocationStyle style = getMyLocationStyle();
|
||||
if ( mCarCursorOption.getCarCursorBmp() != null && !mCarCursorOption.getCarCursorBmp().isRecycled() ) {
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromBitmap( mCarCursorOption.getCarCursorBmp() ) );
|
||||
} else {
|
||||
@@ -877,6 +877,14 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
}
|
||||
|
||||
private MyLocationStyle getMyLocationStyle() {
|
||||
try {
|
||||
return mMapView.getMap().getMyLocationStyle();
|
||||
} catch ( Exception e ) {
|
||||
return new MyLocationStyle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapCameraPosition getMapCameraPosition() {
|
||||
if ( checkAMapView() ) {
|
||||
|
||||
@@ -790,7 +790,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if ( mMapView.getMap() == null ) {
|
||||
return;
|
||||
}
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
MyLocationStyle style = getMyLocationStyle();
|
||||
if ( mCarCursorOption.getCarCursorBmp() != null && !mCarCursorOption.getCarCursorBmp().isRecycled() ) {
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromBitmap( mCarCursorOption.getCarCursorBmp() ) );
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user