This commit is contained in:
wangcongtao
2020-01-06 19:49:05 +08:00
parent 9ad9722cd2
commit 09053f4a0b
106 changed files with 691 additions and 36 deletions

View File

@@ -1,14 +1,21 @@
package com.mogo.module.map;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.map.IMogoMap;
import com.mogo.map.IMogoUiSettings;
import com.mogo.map.MogoLatLng;
import com.mogo.map.MogoMapView;
import com.mogo.map.location.IMogoLocationClient;
import com.mogo.map.location.MogoLocation;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.map.IMogoMapService;
/**
@@ -24,6 +31,20 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
private MogoMapView mMogoMapView;
private IMogoMap mMogoMap;
private View mSearch;
private View mHome;
private View mCompany;
private View mUploadRoadCondition;
private View mVRMode;
private View mMove2CurrentLocation;
private IMogoMapService mService;
private IMogoMapUIController mMApUIController;
private IMogoLocationClient mMogoLocationClient;
@Override
protected int getLayoutId() {
return R.layout.module_map_fragment_map;
@@ -31,9 +52,38 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
@Override
protected void initViews() {
mMogoMapView = findViewById( R.id.module_map_id_map );
mMogoMap = mMogoMapView.getMap();
mMogoMap.getUIController().showMyLocation( true );
mSearch = findViewById( R.id.module_map_id_search );
mSearch.setOnClickListener( view -> {
} );
mHome = findViewById( R.id.module_map_id_home );
mHome.setOnClickListener( view -> {
} );
mCompany = findViewById( R.id.module_map_id_company );
mCompany.setOnClickListener( view -> {
} );
mUploadRoadCondition = findViewById( R.id.module_map_id_upload_road_condition );
mUploadRoadCondition.setOnClickListener( view -> {
} );
mVRMode = findViewById( R.id.module_map_id_vr_mode );
mVRMode.setOnClickListener( view -> {
} );
mMove2CurrentLocation = findViewById( R.id.module_map_id_move2_current_location );
mMove2CurrentLocation.setOnClickListener( view -> {
final MogoLocation location = mMogoLocationClient.getLastKnowLocation();
if ( location != null ) {
mMApUIController.moveToCenter( new MogoLatLng( location.getLatitude(), location.getLongitude() ) );
}
} );
}
@NonNull
@@ -49,6 +99,9 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
mMogoMapView.onCreate( savedInstanceState );
}
initMapView();
mService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getContext() );
mMApUIController = mService.getMapUIController();
mMogoLocationClient = mService.getLocationClient( getContext() );
}
@Override