This commit is contained in:
wangcongtao
2020-10-25 15:51:28 +08:00
40 changed files with 946 additions and 92 deletions

View File

@@ -40,32 +40,35 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
@Override
protected void addDleMaps() {
mAMapView = new AMapBaseMapView().create( getContext() );
mCustomMapView = new CustomMapView().create( getContext() );
if ( mAMapView != null ) {
final View mapView = mAMapView.getMapView();
if ( mapView != null ) {
addView( mapView, new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ) );
if ( !MogoMapDelegateFactory.isUseCustom() ) {
mAMapView = new AMapBaseMapView().create( getContext() );
if ( mAMapView != null ) {
final View mapView = mAMapView.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 MapView instance failed." );
Logger.e( TAG, "create IMogoMapView instance failed." );
}
mMapView = mAMapView;
} else {
Logger.e( TAG, "create IMogoMapView instance failed." );
mCustomMapView = new CustomMapView().create( getContext() );
if ( mCustomMapView != null ) {
final View mapView = mCustomMapView.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." );
}
mMapView = mCustomMapView;
}
// if ( mCustomMapView != null ) {
// final View mapView = mCustomMapView.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." );
// }
mMapView = mAMapView;
MogoMap.getInstance().init( getContext(), mMapView.getMap() );
}