This commit is contained in:
wangcongtao
2020-02-19 15:12:50 +08:00
parent 5217b0b261
commit 68c3105283

View File

@@ -157,8 +157,6 @@ public class AMapNaviViewWrapper implements IMogoMapView,
AMapMessageManager.getInstance().registerAMapMessageListener( this );
}
private Context getContext() {
@@ -423,14 +421,19 @@ public class AMapNaviViewWrapper implements IMogoMapView,
@Override
public void showMyLocation( boolean visible ) {
if ( checkAMapView() ) {
mMapView.getMap().setMyLocationEnabled( true );
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
mMapView.getMap().setMyLocationEnabled( visible );
MyLocationStyle style = null;
if ( visible ) {
style = mMapView.getMap().getMyLocationStyle();
} else {
style = new MyLocationStyle();
}
style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER );
style.interval(1000);
style.interval( 1000 );
style.showMyLocation( visible );
style.strokeColor( Color.TRANSPARENT );
style.strokeWidth( 0 );
style.showMyLocation(visible);
style.showMyLocation( visible );
style.radiusFillColor( Color.TRANSPARENT );
style.myLocationIcon( BitmapDescriptorFactory.fromResource( R.drawable.map_api_ic_current_location ) );
mMapView.getMap().setMyLocationStyle( style );
@@ -547,10 +550,10 @@ public class AMapNaviViewWrapper implements IMogoMapView,
}
@Override
public MogoLatLng getLocationMogoLatLngInScreen(Point point) {
public MogoLatLng getLocationMogoLatLngInScreen( Point point ) {
if ( checkAMapView() ) {
try {
return ObjectUtils.fromAMap(mMapView.getMap().getProjection().fromScreenLocation( point ));
return ObjectUtils.fromAMap( mMapView.getMap().getProjection().fromScreenLocation( point ) );
} catch ( Exception e ) {
return null;
}