91 lines
2.2 KiB
Java
91 lines
2.2 KiB
Java
package com.mogo.map;
|
|
|
|
import android.content.Context;
|
|
import android.os.Bundle;
|
|
import android.util.AttributeSet;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.FrameLayout;
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
import com.mogo.utils.logger.Logger;
|
|
|
|
/**
|
|
* @author congtaowang
|
|
* @since 2019-12-18
|
|
* <p>
|
|
* 地图实例
|
|
*/
|
|
public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
|
|
|
private static final String TAG = "MogoMapView";
|
|
|
|
public MogoMapView( Context context ) {
|
|
super( context );
|
|
}
|
|
|
|
public MogoMapView( Context context, @Nullable AttributeSet attrs ) {
|
|
super( context, attrs );
|
|
}
|
|
|
|
public MogoMapView( Context context, @Nullable AttributeSet attrs, int defStyleAttr ) {
|
|
super( context, attrs, defStyleAttr );
|
|
}
|
|
|
|
private boolean mIsVrMode = false;
|
|
|
|
@Override
|
|
protected void addMapView( Context context ) {
|
|
mMapView = MogoMapDelegateFactory.getMapView( context );
|
|
if ( mMapView != null ) {
|
|
final View mapView = mMapView.getMapView();
|
|
if ( mapView != null ) {
|
|
addView( mapView, new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) );
|
|
} else {
|
|
Logger.e( TAG, "create MapView instance failed." );
|
|
}
|
|
} else {
|
|
Logger.e( TAG, "create IMogoMapView instance failed." );
|
|
}
|
|
}
|
|
|
|
public boolean isVrMode() {
|
|
return mIsVrMode;
|
|
}
|
|
|
|
@Override
|
|
public void onCreate( Bundle bundle ) {
|
|
super.onCreate( bundle );
|
|
Logger.d( TAG, "onCreate" );
|
|
}
|
|
|
|
@Override
|
|
public void onResume() {
|
|
super.onResume();
|
|
Logger.d( TAG, "onResume" );
|
|
}
|
|
|
|
@Override
|
|
public void onPause() {
|
|
super.onPause();
|
|
Logger.d( TAG, "onPause" );
|
|
}
|
|
|
|
@Override
|
|
public void onDestroy() {
|
|
super.onDestroy();
|
|
Logger.d( TAG, "onDestroy" );
|
|
}
|
|
|
|
@Override
|
|
public void onSaveInstanceState( Bundle outState ) {
|
|
super.onSaveInstanceState( outState );
|
|
}
|
|
|
|
@Override
|
|
public void onLowMemory() {
|
|
super.onLowMemory();
|
|
}
|
|
}
|