opt
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user