111 lines
2.8 KiB
Java
111 lines
2.8 KiB
Java
package com.mogo.map;
|
|
|
|
import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
/**
|
|
* @author congtaowang
|
|
* @since 2019-12-18
|
|
* <p>
|
|
* 代理自研地图UiSettings
|
|
*/
|
|
public class AMapUiSettingsWrapper implements IMogoUiSettings {
|
|
|
|
private MapAutoViewHelper mUiSettings;
|
|
|
|
public AMapUiSettingsWrapper( MapAutoViewHelper mUiSettings ) {
|
|
this.mUiSettings = mUiSettings;
|
|
}
|
|
|
|
@Override
|
|
public void setScaleControlsEnabled( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setZoomControlsEnabled( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
mUiSettings.setZoomGesturesEnabled( enabled );
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setCompassEnabled( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
if(enabled){
|
|
mUiSettings.showDirection();
|
|
}else{
|
|
mUiSettings.hiddenDirection();
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setMyLocationButtonEnabled( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
if(enabled){
|
|
mUiSettings.showLocation();
|
|
}else{
|
|
mUiSettings.hiddenLocation();
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setScrollGesturesEnabled( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
mUiSettings.setScrollGesturesEnabled( enabled );
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setZoomGesturesEnabled( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
mUiSettings.setZoomGesturesEnabled( enabled );
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setTiltGesturesEnabled( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
mUiSettings.setTiltGesturesEnabled( enabled );
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setRotateGesturesEnabled( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
mUiSettings.setRotateGesturesEnabled( enabled );
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setAllGesturesEnabled( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
mUiSettings.setAllGesturesEnabled( enabled );
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setIndoorSwitchEnabled( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
// mUiSettings.setIndoorSwitchEnabled( enabled );
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setLogoEnable( boolean enabled ) {
|
|
if ( mUiSettings != null ) {
|
|
try {
|
|
Method method = mUiSettings.getClass().getMethod( "setLogoEnable", boolean.class );
|
|
method.setAccessible( true );
|
|
method.invoke( mUiSettings, enabled );
|
|
} catch ( Exception e ) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|