This commit is contained in:
wangcongtao
2020-05-18 17:05:58 +08:00
parent 8d7e09f81d
commit f5a1925532
34 changed files with 725 additions and 978 deletions

View File

@@ -492,7 +492,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
}
@Override
public void moveToCenter( MogoLatLng latLng ) {
public void moveToCenter( MogoLatLng latLng, boolean animate ) {
Logger.d( TAG, "move to center %s", latLng );
if ( latLng == null || latLng.lat == 0.0d || latLng.lng == 0.0d ) {
Logger.e( TAG, "latlng = null or is illegal" );
@@ -502,7 +502,11 @@ public class AMapNaviViewWrapper implements IMogoMapView,
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
}
loseLockMode();
mMapView.getMap().moveCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) );
if ( animate ) {
mMapView.getMap().animateCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) );
} else {
mMapView.getMap().moveCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) );
}
}
@Override

View File

@@ -85,9 +85,9 @@ public class AMapUIController implements IMogoMapUIController {
}
@Override
public void moveToCenter(MogoLatLng latLng) {
public void moveToCenter(MogoLatLng latLng, boolean animate) {
if (mClient != null) {
mClient.moveToCenter(latLng);
mClient.moveToCenter(latLng, animate);
}
}

View File

@@ -50,7 +50,14 @@ public interface IMogoMapUIController {
/**
* 将地图移动至当前位置
*/
void moveToCenter( MogoLatLng latLng );
default void moveToCenter( MogoLatLng latLng ){
moveToCenter(latLng, false);
}
/**
* 将地图移动至当前位置
*/
void moveToCenter( MogoLatLng latLng, boolean animate );
/**
* 显示我的位置

View File

@@ -79,9 +79,9 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public void moveToCenter(MogoLatLng latLng) {
public void moveToCenter(MogoLatLng latLng, boolean animate) {
if (mDelegate != null) {
mDelegate.moveToCenter(latLng);
mDelegate.moveToCenter(latLng, animate);
}
}