opt
This commit is contained in:
@@ -48,6 +48,7 @@ import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -381,9 +382,20 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom( boolean zoom ) {
|
||||
public MapControlResult changeZoom( boolean zoom ) {
|
||||
if ( checkAMapView() ) {
|
||||
mDefaultZoomLevel = ( int ) ( getMap().getZoomLevel() + 0.5f );
|
||||
|
||||
if ( zoom ) {
|
||||
if ( mDefaultZoomLevel >= 20 ) {
|
||||
return MapControlResult.TARGET;
|
||||
}
|
||||
} else {
|
||||
if ( mDefaultZoomLevel <= 3 ) {
|
||||
return MapControlResult.TARGET;
|
||||
}
|
||||
}
|
||||
|
||||
if ( zoom ) {
|
||||
mDefaultZoomLevel += 2f;
|
||||
if ( mDefaultZoomLevel > 20 ) {
|
||||
@@ -397,15 +409,17 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
changeZoom( ( int ) mDefaultZoomLevel );
|
||||
}
|
||||
return MapControlResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom( float zoom ) {
|
||||
public MapControlResult changeZoom( float zoom ) {
|
||||
Logger.d( TAG, "changeZoom %s", zoom );
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
getMap().changeZoom( zoom );
|
||||
return MapControlResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.marker.MogoMarkersHandler;
|
||||
import com.mogo.map.navi.MogoCalculatePath;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -180,27 +181,17 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
|
||||
return;
|
||||
}
|
||||
checkAMapInstance();
|
||||
mAMap.animateCamera( CameraUpdateFactory.newLatLngBoundsRect(
|
||||
mAMap.moveCamera( CameraUpdateFactory.newLatLngBoundsRect(
|
||||
bounds,
|
||||
mBoundRect.left,
|
||||
mBoundRect.right,
|
||||
mBoundRect.top,
|
||||
mBoundRect.bottom ),
|
||||
new AMap.CancelableCallback() {
|
||||
@Override
|
||||
public void onFinish() {
|
||||
if ( after != null ) {
|
||||
after.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
if ( after != null ) {
|
||||
after.run();
|
||||
}
|
||||
}
|
||||
} );
|
||||
mBoundRect.bottom ));
|
||||
UiThreadHandler.postDelayed( ()->{
|
||||
if ( after != null ) {
|
||||
after.run();
|
||||
}
|
||||
}, 2000 );
|
||||
}
|
||||
|
||||
private void checkAMapInstance() {
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.map.MogoMap;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
@@ -59,17 +60,19 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom(boolean zoom) {
|
||||
public MapControlResult changeZoom( boolean zoom) {
|
||||
if (mClient != null) {
|
||||
mClient.changeZoom(zoom);
|
||||
return mClient.changeZoom(zoom);
|
||||
}
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom(float zoom) {
|
||||
public MapControlResult changeZoom(float zoom) {
|
||||
if (mClient != null) {
|
||||
mClient.changeZoom(zoom);
|
||||
return mClient.changeZoom(zoom);
|
||||
}
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user