add switch map logic
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.map.impl.amap">
|
||||
package="com.mogo.map.impl.custom">
|
||||
|
||||
<application>
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package com.mogo.map.impl.custom;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.MogoBaseMapView;
|
||||
import com.mogo.map.IMogoMapViewCreator;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.MapParams;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
@@ -18,35 +15,23 @@ import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class AMapBaseMapView extends MogoBaseMapView {
|
||||
public class AMapBaseMapView implements IMogoMapViewCreator {
|
||||
|
||||
private static final String TAG = "AMapBaseMapView";
|
||||
|
||||
public AMapBaseMapView( Context context ) {
|
||||
super( context );
|
||||
}
|
||||
|
||||
public AMapBaseMapView( Context context, @Nullable AttributeSet attrs ) {
|
||||
super( context, attrs );
|
||||
}
|
||||
|
||||
public AMapBaseMapView( Context context, @Nullable AttributeSet attrs, int defStyleAttr ) {
|
||||
super( context, attrs, defStyleAttr );
|
||||
}
|
||||
|
||||
|
||||
private MapAutoView mapAutoView;
|
||||
|
||||
@Override
|
||||
protected IMogoMapView createMapView( Context context ) {
|
||||
Log.i(TAG, "autoop--createMapView: ");
|
||||
if(mapAutoView == null){
|
||||
Log.i(TAG, "autoop--createMapView: mapAutoView is null create");
|
||||
MapAutoApi.INSTANCE.init(MapParams.Companion.init().setDebugMode(false)
|
||||
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_2D)
|
||||
.setStyleMode(MapParams.MAP_STYLE_NIGHT));
|
||||
mapAutoView = new MapAutoView( context );
|
||||
public IMogoMapView create( Context context ) {
|
||||
Log.i( TAG, "autoop--createMapView: " );
|
||||
if ( mapAutoView == null ) {
|
||||
Log.i( TAG, "autoop--createMapView: mapAutoView is null create" );
|
||||
MapAutoApi.INSTANCE.init( MapParams.Companion.init().setDebugMode( false )
|
||||
.setCoordinateType( MapParams.COORDINATETYPE_GCJ02 )
|
||||
.setPerspectiveMode( MapParams.MAP_PERSPECTIVE_2D )
|
||||
.setStyleMode( MapParams.MAP_STYLE_NIGHT ) );
|
||||
mapAutoView = new MapAutoView( context );
|
||||
}
|
||||
return new AMapViewWrapper(mapAutoView);
|
||||
return new AMapViewWrapper( mapAutoView );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class AMapViewWrapper implements IMogoMapView, IMogoMapUIController, Loca
|
||||
if (mMapView != null) {
|
||||
mMapView.onCreate(bundle);
|
||||
Logger.d(TAG, "map onCreate");
|
||||
// initMapView();
|
||||
initMapView();
|
||||
initListeners();
|
||||
// initMyLocation();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.mogo.map.impl.custom.search;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.search.drive.IMogoRoadSearch;
|
||||
import com.mogo.map.search.drive.IMogoRoadSearchListener;
|
||||
import com.mogo.map.search.drive.MogoRoadSearchQuery;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/1
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class RoadSearchClient implements IMogoRoadSearch {
|
||||
|
||||
private static final String TAG = "DriveSearchClient";
|
||||
|
||||
private IMogoRoadSearchListener mListener;
|
||||
|
||||
@Override
|
||||
public void searchRoadPath( Context context,
|
||||
MogoRoadSearchQuery query ) {
|
||||
|
||||
}
|
||||
|
||||
private boolean checkPoint( MogoLatLng latLng, String msg ) {
|
||||
if ( latLng == null ) {
|
||||
Logger.e( TAG, msg + " is null" );
|
||||
return false;
|
||||
}
|
||||
if ( latLng.lat <= 0d || latLng.lon <= 0d ) {
|
||||
Logger.e( TAG, msg + " is not a valid " );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRoadPathSearchListener( IMogoRoadSearchListener listener ) {
|
||||
mListener = listener;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user