dev
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -5,7 +5,7 @@
|
||||
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
||||
</configurations>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -16,12 +16,14 @@ android {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
externalNativeBuild {
|
||||
ndk {
|
||||
// 设置支持的SO库架构
|
||||
abiFilters 'armeabi'
|
||||
}
|
||||
}
|
||||
|
||||
multiDexEnabled true
|
||||
// externalNativeBuild {
|
||||
// ndk {
|
||||
// // 设置支持的SO库架构
|
||||
// abiFilters 'armeabi'
|
||||
// }
|
||||
// }
|
||||
}
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -51,6 +53,7 @@ dependencies {
|
||||
debugImplementation rootProject.ext.dependencies.leakcanary
|
||||
testImplementation rootProject.ext.dependencies.leakcanary
|
||||
releaseImplementation rootProject.ext.dependencies.leakcanarynoop
|
||||
releaseImplementation rootProject.ext.dependencies.androidxmultidex
|
||||
implementation project(':modules:mogo-module-main')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme.App">
|
||||
|
||||
<!-- 高德地图 -->
|
||||
<meta-data
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="a36b9f7b086fa3951bb35338a5a06dd3" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.mogo.launcher;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
|
||||
@@ -16,4 +19,10 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext( Context base ) {
|
||||
super.attachBaseContext( base );
|
||||
MultiDex.install( base );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,12 @@ allprojects {
|
||||
}
|
||||
google()
|
||||
jcenter()
|
||||
// flatDir {
|
||||
// 由于Library module中引用了 youkuplayer 库的 aar,在多 module 的情况下,
|
||||
// 其他的module编译会报错,所以需要在所有工程的repositories
|
||||
// 下把Library module中的libs目录添加到依赖关系中
|
||||
// dirs project(':libraries:map-baidu').file('libs')
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ ext {
|
||||
// androidx
|
||||
androidxappcompat : "androidx.appcompat:appcompat:1.0.2",
|
||||
androidxconstraintlayout: "androidx.constraintlayout:constraintlayout:1.1.3",
|
||||
androidxmultidex : "androidx.multidex:multidex:2.0.1",
|
||||
// 测试
|
||||
junit : "junit:junit:4.12",
|
||||
androidxjunit : "androidx.test.ext:junit:1.1.0",
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.DialogInterface;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
@@ -17,28 +18,31 @@ import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.location.ILocationListener;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
|
||||
import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -55,7 +59,7 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
IMogoModuleLifecycle,
|
||||
IMogoMapListener,
|
||||
IMogoPoiSearchListener,
|
||||
ILocationListener {
|
||||
IMogoLocationListener {
|
||||
|
||||
private static final String TAG = "demo.DemoCardViewProvider";
|
||||
|
||||
@@ -66,12 +70,16 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
private Bitmap mClickedMarkerIcon;
|
||||
private TextView mLocInfo;
|
||||
private TextView mLoc;
|
||||
private Button m2D3D;
|
||||
|
||||
private IMogoMarker mLastClickedMarker;
|
||||
|
||||
private IMogoMapService mMapService;
|
||||
private IMogoPoiSearch mPoiSearch;
|
||||
private IMogoLocationClient mLocationClient;
|
||||
private IMogoMarkerManager mMarkerManager;
|
||||
private IMogoNavi mNavi;
|
||||
private IMogoMapUIController mMapUIController;
|
||||
|
||||
private DemoInfoWindowAdapter mDemoInfoWindowAdapter;
|
||||
|
||||
@@ -88,6 +96,11 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
mPoiSearch.setPoiSearchListener( this );
|
||||
mLocationClient = mMapService.getSingletonLocationClient( getContext() );
|
||||
mLocationClient.addLocationListener( this );
|
||||
mMarkerManager = mMapService.getMarkerManager( getContext() );
|
||||
mNavi = mMapService.getNavi( getContext() );
|
||||
mMapUIController = mMapService.getMapUIController();
|
||||
|
||||
m2D3D = findViewById( R.id.demo_module_id_2d3d );
|
||||
|
||||
mLocInfo = findViewById( R.id.demo_module_id_loc_info );
|
||||
mLoc = findViewById( R.id.demo_module_id_loc );
|
||||
@@ -100,10 +113,10 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
}
|
||||
);
|
||||
|
||||
mDemoInfoWindowAdapter = new DemoInfoWindowAdapter( getContext() );
|
||||
mDemoInfoWindowAdapter = new DemoInfoWindowAdapter( getContext(), mNavi );
|
||||
|
||||
mMarkerIcon = BitmapFactory.decodeResource( getResources(), R.drawable.ic_launcher );
|
||||
mClickedMarkerIcon = BitmapFactory.decodeResource( getResources(), R.drawable.ic_launcher_round );
|
||||
mMarkerIcon = BitmapFactory.decodeResource( getResources(), R.drawable.ic_search_poi_location );
|
||||
mClickedMarkerIcon = BitmapFactory.decodeResource( getResources(), R.drawable.ic_search_choice_point );
|
||||
mAddMarker = findViewById( R.id.demo_module_id_add_marker );
|
||||
mAddMarker.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -112,7 +125,7 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
.icon( mMarkerIcon )
|
||||
.latitude( 39.974525d )
|
||||
.longitude( 116.41733d );
|
||||
IMogoMarker marker = mMapService.addMarker( DemoConstants.TAG, options );
|
||||
IMogoMarker marker = mMarkerManager.addMarker( DemoConstants.TAG, options );
|
||||
marker.setInfoWindowAdapter( mDemoInfoWindowAdapter );
|
||||
marker.setOnMarkerClickListener( DemoCardViewFragment.this );
|
||||
}
|
||||
@@ -130,7 +143,7 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
.longitude( 116.41733d + new Random().nextDouble() );
|
||||
optionsList.add( options );
|
||||
}
|
||||
List< IMogoMarker > iMogoMarkers = mMapService.addMarkers( DemoConstants.TAG, optionsList, true );
|
||||
List< IMogoMarker > iMogoMarkers = mMarkerManager.addMarkers( DemoConstants.TAG, optionsList, true );
|
||||
for ( IMogoMarker iMogoMarker : iMogoMarkers ) {
|
||||
iMogoMarker.setInfoWindowAdapter( mDemoInfoWindowAdapter );
|
||||
iMogoMarker.setOnMarkerClickListener( DemoCardViewFragment.this );
|
||||
@@ -141,7 +154,81 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
findViewById( R.id.demo_module_id_clear ).setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
mMapService.removeMarkers( DemoConstants.TAG );
|
||||
mMarkerManager.removeMarkers( DemoConstants.TAG );
|
||||
}
|
||||
} );
|
||||
|
||||
m2D3D.setOnClickListener( new View.OnClickListener() {
|
||||
|
||||
private EnumMapUI ui = EnumMapUI.NorthUP_2D;
|
||||
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
mMapUIController.changeMapMode( ui = ui.next() );
|
||||
m2D3D.setText( ui.toString() );
|
||||
}
|
||||
} );
|
||||
|
||||
findViewById( R.id.demo_module_id_current ).setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
mMapUIController.moveToCurrentLocation();
|
||||
}
|
||||
} );
|
||||
|
||||
findViewById( R.id.demo_module_id_start_navi ).setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
mNavi.startNavi();
|
||||
}
|
||||
} );
|
||||
|
||||
findViewById( R.id.demo_module_id_stop_navi ).setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
mNavi.stopNavi();
|
||||
}
|
||||
} );
|
||||
|
||||
findViewById( R.id.demo_module_id_traffic ).setOnClickListener( new View.OnClickListener() {
|
||||
|
||||
private boolean enable = true;
|
||||
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
mMapUIController.setTrafficEnabled( enable = !enable );
|
||||
}
|
||||
} );
|
||||
|
||||
findViewById( R.id.demo_module_id_zoom_in ).setOnClickListener( new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
mMapUIController.changeZoom( true );
|
||||
}
|
||||
} );
|
||||
|
||||
findViewById( R.id.demo_module_id_zoom_out ).setOnClickListener( new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
mMapUIController.changeZoom( false );
|
||||
}
|
||||
} );
|
||||
|
||||
findViewById( R.id.demo_module_id_day_light ).setOnClickListener( new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
mMapUIController.changeMapMode( EnumMapUI.Type_Light );
|
||||
}
|
||||
} );
|
||||
|
||||
findViewById( R.id.demo_module_id_day_night ).setOnClickListener( new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
mMapUIController.changeMapMode( EnumMapUI.Type_Night );
|
||||
}
|
||||
} );
|
||||
}
|
||||
@@ -189,7 +276,7 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
|
||||
@Override
|
||||
public void onTouch( MotionEvent motionEvent ) {
|
||||
Logger.d( TAG, "地图触摸事件" );
|
||||
// Logger.d( TAG, "地图触摸事件" );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -205,27 +292,25 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
|
||||
}
|
||||
|
||||
private IMogoMarker mPoiMarker;
|
||||
|
||||
@Override
|
||||
public void onPoiItemSearched( MogoPoiItem item, int errorCode ) {
|
||||
if ( item == null ) {
|
||||
return;
|
||||
}
|
||||
new AlertDialog.Builder( getContext() )
|
||||
.setTitle( item.getTitle() )
|
||||
.setMessage(
|
||||
new StringBuilder()
|
||||
.append( "adCode:" ).append( item.getAdCode() ).append( "\n" )
|
||||
.append( "cityCode:" ).append( item.getCityCode() ).append( "\n" )
|
||||
.append( "email:" ).append( item.getEmail() ).append( "\n" )
|
||||
.append( "tel:" ).append( item.getTel() ).append( "\n" )
|
||||
)
|
||||
.setNegativeButton( "知道了", new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( DialogInterface dialog, int which ) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
} )
|
||||
.show();
|
||||
if ( mPoiMarker != null ) {
|
||||
mPoiMarker.destroy();
|
||||
}
|
||||
mPoiMarker = mMarkerManager.addMarker( DemoConstants.TAG, new MogoMarkerOptions()
|
||||
.longitude( item.getPoint().lng )
|
||||
.latitude( item.getPoint().lat )
|
||||
.icon( mMarkerIcon ) );
|
||||
if ( mPoiMarker != null ) {
|
||||
mPoiMarker.setInfoWindowAdapter( mDemoInfoWindowAdapter );
|
||||
mPoiMarker.setObject( item );
|
||||
mPoiMarker.showInfoWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -241,6 +326,21 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick( MogoLatLng latLng ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap( boolean isLock ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged( EnumMapUI ui ) {
|
||||
Logger.d( TAG, ui.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
@@ -250,6 +350,9 @@ public class DemoCardViewFragment extends MvpFragment< IView, Presenter< IView >
|
||||
mLastClickedMarker.destroy();
|
||||
mLastClickedMarker = null;
|
||||
}
|
||||
if ( mPoiSearch != null ) {
|
||||
mPoiSearch.destroy();
|
||||
}
|
||||
mMapService = null;
|
||||
mPoiSearch = null;
|
||||
mLocationClient = null;
|
||||
|
||||
@@ -8,6 +8,7 @@ import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
@@ -60,4 +61,9 @@ public class DemoCardViewProvider implements IMogoModuleProvider {
|
||||
public int getType() {
|
||||
return IMogoModuleProvider.TYPE_FRAGMENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoNaviListener getNaviListener() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ import android.widget.TextView;
|
||||
|
||||
import com.mogo.map.marker.IMogoInfoWindowAdapter;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -21,16 +24,25 @@ import java.util.Date;
|
||||
public class DemoInfoWindowAdapter implements IMogoInfoWindowAdapter {
|
||||
|
||||
private Context mContext;
|
||||
private IMogoNavi mNavi;
|
||||
|
||||
public DemoInfoWindowAdapter( Context mContext ) {
|
||||
public DemoInfoWindowAdapter( Context mContext, IMogoNavi mNavi ) {
|
||||
this.mContext = mContext;
|
||||
this.mNavi = mNavi;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getInfoWindow( IMogoMarker marker ) {
|
||||
View view = LayoutInflater.from( mContext ).inflate( R.layout.demo_module_demo_info_window, null );
|
||||
renderView( view, marker );
|
||||
return view;
|
||||
if ( marker.getObject() instanceof MogoPoiItem ) {
|
||||
View view = LayoutInflater.from( mContext ).inflate( R.layout.demo_module_demo_poi_info_window, null );
|
||||
renderPoiVew( view, marker, ( ( MogoPoiItem ) marker.getObject() ) );
|
||||
return view;
|
||||
} else {
|
||||
View view = LayoutInflater.from( mContext ).inflate( R.layout.demo_module_demo_info_window, null );
|
||||
renderView( view, marker );
|
||||
return view;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void renderView( View view, final IMogoMarker marker ) {
|
||||
@@ -43,6 +55,40 @@ public class DemoInfoWindowAdapter implements IMogoInfoWindowAdapter {
|
||||
marker.showInfoWindow();
|
||||
}
|
||||
} );
|
||||
Button navi2 = view.findViewById( R.id.demo_module_id_iw_navito );
|
||||
navi2.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
if ( mNavi != null ) {
|
||||
mNavi.naviTo( marker.getPosition(), new MogoNaviConfig().realNavi( false ) );
|
||||
}
|
||||
}
|
||||
} );
|
||||
Button stopNavi = view.findViewById( R.id.demo_module_id_iw_navi_stop );
|
||||
stopNavi.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
if ( mNavi != null ) {
|
||||
mNavi.stopNavi();
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
private void renderPoiVew( View view, final IMogoMarker marker, MogoPoiItem item ) {
|
||||
final TextView time = view.findViewById( R.id.demo_module_id_iw_poi_title );
|
||||
time.setText( item.getTitle() );
|
||||
Button navi2 = view.findViewById( R.id.demo_module_id_iw_poi_navito );
|
||||
navi2.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
if ( mNavi != null ) {
|
||||
mNavi.naviTo( marker.getPosition(), new MogoNaviConfig().realNavi( false ) );
|
||||
}
|
||||
marker.hideInfoWindow();
|
||||
marker.remove();
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,55 +1,136 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="300dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="#ff0000">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/demo_module_id_loc_info"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_add_marker"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="添加一个覆盖物"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<TextView
|
||||
android:id="@+id/demo_module_id_loc_info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_add_markers"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50dp"
|
||||
android:text="添加多个覆盖物"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_loc"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="100dp"
|
||||
android:text="定位"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_add_marker"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="添加一个覆盖物" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_clear"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="100dp"
|
||||
android:text="清空覆盖物"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_add_markers"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="添加多个覆盖物" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_clear"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="清空覆盖物" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_loc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="定位" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_current"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="当前位置" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_2d3d"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2D/3D" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_traffic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="交通态势" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_start_navi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="开始导航" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_stop_navi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="停止导航" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_zoom_in"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="放大" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_zoom_out"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="缩小" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_day_light"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="白天" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_day_night"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="黑夜" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</ScrollView>
|
||||
@@ -19,7 +19,27 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="点击刷新当前时间"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_iw_navito"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="70dp"
|
||||
android:text="导航去这里"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_iw_navi_stop"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="120dp"
|
||||
android:text="停止导航"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ff0000">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/demo_module_id_iw_poi_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/demo_module_id_iw_poi_navito"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="70dp"
|
||||
android:text="导航去这里"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -80,6 +80,9 @@ public abstract class MvpFragment< V extends IView, P extends Presenter< V > > e
|
||||
@Nullable
|
||||
@Override
|
||||
public Context getContext() {
|
||||
if ( mContext == null ) {
|
||||
mContext = super.getContext();
|
||||
}
|
||||
return mContext;
|
||||
}
|
||||
|
||||
|
||||
1
libraries/map-amap/.gitignore
vendored
Normal file
1
libraries/map-amap/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
37
libraries/map-amap/build.gradle
Normal file
37
libraries/map-amap/build.gradle
Normal file
@@ -0,0 +1,37 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.2"
|
||||
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
implementation rootProject.ext.dependencies.amapnavi3dmap
|
||||
implementation rootProject.ext.dependencies.amapsearch
|
||||
implementation rootProject.ext.dependencies.amaplocation
|
||||
|
||||
implementation project(':foudations:mogo-utils')
|
||||
implementation project(':libraries:mogo-map-api')
|
||||
}
|
||||
0
libraries/map-amap/consumer-rules.pro
Normal file
0
libraries/map-amap/consumer-rules.pro
Normal file
21
libraries/map-amap/proguard-rules.pro
vendored
Normal file
21
libraries/map-amap/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith( AndroidJUnit4.class )
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
|
||||
assertEquals( "com.mogo.map.impl.amap.test", appContext.getPackageName() );
|
||||
}
|
||||
}
|
||||
10
libraries/map-amap/src/main/AndroidManifest.xml
Normal file
10
libraries/map-amap/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.map.impl.amap">
|
||||
|
||||
<application>
|
||||
<!-- 高德地图 -->
|
||||
<meta-data
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="a36b9f7b086fa3951bb35338a5a06dd3" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.navi.AMapNaviView;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.MogoBaseMapView;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class AMapBaseMapView extends MogoBaseMapView {
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IMogoMapView createMapView( Context context ) {
|
||||
return new AMapNaviViewWrapper( new AMapNaviView( context ) );
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.map.amap;
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import com.amap.api.maps.model.Marker;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
@@ -0,0 +1,303 @@
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.maps.model.Marker;
|
||||
import com.amap.api.maps.model.Poi;
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.navi.AMapNaviListener;
|
||||
import com.amap.api.navi.AMapNaviView;
|
||||
import com.amap.api.navi.AMapNaviViewListener;
|
||||
import com.amap.api.navi.AMapNaviViewOptions;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.impl.amap.navi.NaviClient;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-18
|
||||
* <p>
|
||||
* 代理高德导航地图
|
||||
*/
|
||||
public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
AMap.OnMarkerClickListener,
|
||||
AMap.OnMapLoadedListener,
|
||||
AMap.OnMapTouchListener,
|
||||
AMap.OnPOIClickListener,
|
||||
AMap.OnMapClickListener,
|
||||
AMap.OnPolylineClickListener,
|
||||
AMapNaviViewListener {
|
||||
|
||||
private static final String TAG = "AMapNaviViewWrapper";
|
||||
|
||||
private final AMapNaviView mMapView;
|
||||
private IMogoMap mIMap;
|
||||
|
||||
private AMapMarkerClickHandler mMarkerClickHandler;
|
||||
|
||||
public AMapNaviViewWrapper( AMapNaviView mapView ) {
|
||||
this.mMapView = mapView;
|
||||
this.mIMap = new AMapWrapper( mMapView.getMap(), mMapView );
|
||||
initMapView();
|
||||
initListeners();
|
||||
}
|
||||
|
||||
private void initMapView() {
|
||||
if ( mMapView != null ) {
|
||||
AMapNaviViewOptions options = mMapView.getViewOptions();
|
||||
if ( options != null ) {
|
||||
// 设置是否开启自动黑夜模式切换,默认为false,不自动切换
|
||||
options.setAutoNaviViewNightMode( false );
|
||||
// 设置6秒后是否自动锁车
|
||||
options.setAutoLockCar( true );
|
||||
// 设置路线上的摄像头气泡是否显示
|
||||
options.setCameraBubbleShow( true );
|
||||
// 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。
|
||||
// options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() );
|
||||
// 设置自车的图片对象
|
||||
options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), R.drawable.ic_search_poi_location ) );
|
||||
// 设置指南针图标否在导航界面显示,默认显示。true,显示;false,隐藏。
|
||||
options.setCompassEnabled( false );
|
||||
//设置路况光柱条是否显示(只适用于驾车导航,需要联网)。
|
||||
options.setTrafficBarEnabled( false );
|
||||
// 设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。
|
||||
options.setTrafficLayerEnabled( false );
|
||||
// 设置导航界面是否显示路线全览按钮。
|
||||
options.setRouteListButtonShow( false );
|
||||
// 设置起点位图,须在画路前设置
|
||||
// options.setStartPointBitmap( BitmapFactory.decodeResource( getContext().getResources(), R.drawable.ic_current_location_cursor ) );
|
||||
// 设置终点位图,须在画路前设置
|
||||
// options.setEndPointBitmap( BitmapFactory.decodeResource( getContext().getResources(), R.drawable.ic_search_choice_point ) );
|
||||
// 设置导航状态下屏幕是否一直开启。
|
||||
options.setScreenAlwaysBright( true );
|
||||
// 设置交通播报是否打开(只适用于驾车导航,需要联网)。
|
||||
options.setTrafficInfoUpdateEnabled( true );
|
||||
// 设置摄像头播报是否打开(只适用于驾车导航)。
|
||||
options.setCameraInfoUpdateEnabled( true );
|
||||
// 设置菜单按钮是否在导航界面显示。
|
||||
options.setSettingMenuEnabled( false );
|
||||
// 设置是否绘制显示交通路况的线路(彩虹线),拥堵-红色,畅通-绿色,缓慢-黄色,未知-蓝色。默认不绘制彩虹线。
|
||||
options.setTrafficLine( true );
|
||||
// 设置是否绘制牵引线(当前位置到目的地的指引线)。默认不绘制牵引线。
|
||||
options.setLeaderLineEnabled( -1 );
|
||||
// 设置导航界面UI是否显示。
|
||||
options.setLayoutVisible( false );
|
||||
// 设置是否自动画路
|
||||
options.setAutoDrawRoute( false );
|
||||
// 设置是否显示路口放大图(实景图)
|
||||
options.setRealCrossDisplayShow( false );
|
||||
// 设置是否显示路口放大图(路口模型图)
|
||||
options.setModeCrossDisplayShow( false );
|
||||
// 设置是否显示道路信息view
|
||||
options.setLaneInfoShow( false );
|
||||
// 设置是否自动改变缩放等级
|
||||
options.setAutoChangeZoom( false );
|
||||
// 设置是否自动全览模式,即在算路成功后自动进入全览模式
|
||||
options.setAutoDisplayOverview( false );
|
||||
// 设置路线转向箭头隐藏和显示
|
||||
options.setNaviArrowVisible( false );
|
||||
// 通过路线是否自动置灰,仅支持驾车导航
|
||||
options.setAfterRouteAutoGray( true );
|
||||
options.setPointToCenter( 0.5D, 0.5D );
|
||||
// 2D模式
|
||||
options.setTilt( 0 );
|
||||
mMapView.setViewOptions( options );
|
||||
}
|
||||
mMapView.setRouteOverlayVisible( false );
|
||||
mMapView.setNaviMode( AMapNaviView.NORTH_UP_MODE );
|
||||
}
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
mMapView.setOnMarkerClickListener( this );
|
||||
mMarkerClickHandler = new AMapMarkerClickHandler();
|
||||
mMapView.setOnMapLoadedListener( this );
|
||||
mMapView.setOnMapTouchListener( this );
|
||||
mMapView.setOnPolylineClickListener( this );
|
||||
mMapView.setAMapNaviViewListener( this );
|
||||
if ( mMapView.getMap() != null ) {
|
||||
mMapView.getMap().setOnPOIClickListener( this );
|
||||
mMapView.getMap().setOnMapClickListener( this );
|
||||
}
|
||||
}
|
||||
|
||||
private Context getContext() {
|
||||
return mMapView.getContext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getMapView() {
|
||||
return mMapView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMap getMap() {
|
||||
return mIMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate( Bundle bundle ) {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onCreate( bundle );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onPause();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState( Bundle outState ) {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onSaveInstanceState( outState );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 地图marker点击
|
||||
*
|
||||
* @param marker
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean onMarkerClick( Marker marker ) {
|
||||
return mMarkerClickHandler.handleMarkerClicked( marker );
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图加载完毕
|
||||
*/
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
MogoMapListenerHandler.getInstance().onMapLoaded();
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图点击回调
|
||||
*
|
||||
* @param motionEvent
|
||||
*/
|
||||
@Override
|
||||
public void onTouch( MotionEvent motionEvent ) {
|
||||
MogoMapListenerHandler.getInstance().onTouch( motionEvent );
|
||||
}
|
||||
|
||||
/**
|
||||
* POI 点击
|
||||
*
|
||||
* @param poi
|
||||
*/
|
||||
@Override
|
||||
public void onPOIClick( Poi poi ) {
|
||||
if ( InterceptorHandler.getInstance().ignorePoiClickedWhenNaviing( getContext() ) ) {
|
||||
return;
|
||||
}
|
||||
MogoMapListenerHandler.getInstance().onPOIClick( ObjectUtils.fromAMap( poi ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick( LatLng latLng ) {
|
||||
if ( InterceptorHandler.getInstance().ignoreMapClickedWhenNaviing( getContext() ) ) {
|
||||
return;
|
||||
}
|
||||
MogoMapListenerHandler.getInstance().onMapClick( ObjectUtils.fromAMap( latLng ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPolylineClick( Polyline polyline ) {
|
||||
NaviClient.getInstance( getContext() ).handleClickedPolyline( polyline );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviSetting() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviCancel() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNaviBackClick() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviMapMode( int i ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviTurnClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNextRoadClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScanViewButtonClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap( boolean isLock ) {
|
||||
MogoMapListenerHandler.getInstance().onLockMap( isLock );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviViewLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapTypeChanged( int type ) {
|
||||
if ( type == AMap.MAP_TYPE_NAVI ) {
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged( EnumMapUI.Type_Navi );
|
||||
} else if ( type == AMap.MAP_TYPE_NORMAL ) {
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged( EnumMapUI.Type_Light );
|
||||
} else if ( type == AMap.MAP_TYPE_NIGHT ) {
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged( EnumMapUI.Type_Light );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviViewShowMode( int i ) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.map.amap;
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import com.amap.api.maps.UiSettings;
|
||||
import com.mogo.map.IUiSettings;
|
||||
import com.mogo.map.IMogoUiSettings;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.lang.reflect.Method;
|
||||
* <p>
|
||||
* 代理高德地图UiSettings
|
||||
*/
|
||||
public class AMapUiSettingsWrapper implements IUiSettings {
|
||||
public class AMapUiSettingsWrapper implements IMogoUiSettings {
|
||||
|
||||
private UiSettings mUiSettings;
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.amap.api.maps.CameraUpdateFactory;
|
||||
import com.amap.api.maps.model.BitmapDescriptorFactory;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.maps.model.Marker;
|
||||
import com.amap.api.maps.model.MarkerOptions;
|
||||
import com.amap.api.maps.model.MyLocationStyle;
|
||||
import com.amap.api.navi.AMapNaviView;
|
||||
import com.amap.api.navi.AMapNaviViewOptions;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoUiSettings;
|
||||
import com.mogo.map.impl.amap.location.ALocationClient;
|
||||
import com.mogo.map.impl.amap.marker.AMapInfoWindowAdapter;
|
||||
import com.mogo.map.impl.amap.marker.AMapMarkerWrapper;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.marker.MogoMarkersHandler;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-18
|
||||
* <p>
|
||||
* 代理高德AMap
|
||||
*/
|
||||
public class AMapWrapper implements IMogoMap, IMogoMapUIController {
|
||||
|
||||
private static final String TAG = "AMapWrapper";
|
||||
|
||||
private static AMap sAMap;
|
||||
private AMap mAMap;
|
||||
private AMapNaviView mMapView;
|
||||
private IMogoUiSettings mUiSettings;
|
||||
|
||||
public AMapWrapper( AMap map, AMapNaviView mapView ) {
|
||||
this.mAMap = map;
|
||||
sAMap = map;
|
||||
this.mMapView = mapView;
|
||||
// 设置实现自定义 info window
|
||||
mAMap.setInfoWindowAdapter( new AMapInfoWindowAdapter() );
|
||||
}
|
||||
|
||||
public static AMap getAMap() {
|
||||
return sAMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoUiSettings getUiSettings() {
|
||||
if ( !checkAMap() ) {
|
||||
return null;
|
||||
}
|
||||
if ( mUiSettings == null ) {
|
||||
mUiSettings = new AMapUiSettingsWrapper( mAMap.getUiSettings() );
|
||||
}
|
||||
return mUiSettings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getUIController() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMarker addMarker( String tag, MogoMarkerOptions options ) {
|
||||
if ( !checkAMap() ) {
|
||||
return null;
|
||||
}
|
||||
MarkerOptions markerOptions = ObjectUtils.fromMogo( options );
|
||||
if ( markerOptions == null ) {
|
||||
Logger.e( TAG, "marker参数为空" );
|
||||
return null;
|
||||
}
|
||||
final IMogoMarker mogoMarker = new AMapMarkerWrapper( mAMap.addMarker( markerOptions ) );
|
||||
MogoMarkersHandler.getInstance().add( tag, mogoMarker );
|
||||
return mogoMarker;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList< IMogoMarker > addMarkers( String tag, ArrayList< MogoMarkerOptions > options, boolean moveToCenter ) {
|
||||
if ( !checkAMap() ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( options == null || options.isEmpty() ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 地图导航时,忽略参数
|
||||
if ( InterceptorHandler.getInstance().ignoreAddMarkersMoveToCenterParameters( getContext() ) ) {
|
||||
moveToCenter = false;
|
||||
}
|
||||
|
||||
ArrayList< Marker > markers = null;
|
||||
ArrayList< MarkerOptions > markerOptions = new ArrayList<>();
|
||||
ArrayList< IMogoMarker > mogoMarkers = new ArrayList<>();
|
||||
|
||||
for ( MogoMarkerOptions option : options ) {
|
||||
if ( option == null ) {
|
||||
continue;
|
||||
}
|
||||
MarkerOptions mo = ObjectUtils.fromMogo( option );
|
||||
if ( mo == null ) {
|
||||
continue;
|
||||
}
|
||||
markerOptions.add( mo );
|
||||
}
|
||||
if ( markerOptions.isEmpty() ) {
|
||||
return null;
|
||||
}
|
||||
markers = mAMap.addMarkers( markerOptions, moveToCenter );
|
||||
if ( markers == null || markers.isEmpty() ) {
|
||||
return null;
|
||||
}
|
||||
for ( Marker marker : markers ) {
|
||||
if ( marker == null ) {
|
||||
continue;
|
||||
}
|
||||
mogoMarkers.add( new AMapMarkerWrapper( marker ) );
|
||||
}
|
||||
MogoMarkersHandler.getInstance().add( tag, mogoMarkers );
|
||||
return mogoMarkers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
if ( checkAMap() ) {
|
||||
mAMap.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear( boolean isKeepMyLocationOverlay ) {
|
||||
if ( checkAMap() ) {
|
||||
mAMap.clear( isKeepMyLocationOverlay );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter( int x, int y ) {
|
||||
if ( checkAMap() ) {
|
||||
mAMap.setPointToCenter( x, y );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTouchPoiEnable( boolean touchPoiEnable ) {
|
||||
if ( checkAMap() ) {
|
||||
mAMap.setTouchPoiEnable( touchPoiEnable );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnable( boolean enable ) {
|
||||
if ( checkAMap() ) {
|
||||
mAMap.setTrafficEnabled( enable );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showBuildings( boolean enabled ) {
|
||||
if ( checkAMap() ) {
|
||||
mAMap.showBuildings( enabled );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showIndoorMap( boolean enable ) {
|
||||
if ( checkAMap() ) {
|
||||
mAMap.showIndoorMap( enable );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMapText( boolean enable ) {
|
||||
if ( checkAMap() ) {
|
||||
mAMap.showMapText( enable );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAnimation() {
|
||||
if ( checkAMap() ) {
|
||||
mAMap.stopAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnabled( boolean visible ) {
|
||||
if ( checkAMap() ) {
|
||||
mAMap.setTrafficEnabled( visible );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom( boolean zoom ) {
|
||||
if ( checkAMapView() ) {
|
||||
if ( zoom ) {
|
||||
mMapView.zoomIn();
|
||||
} else {
|
||||
mMapView.zoomOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMapMode( EnumMapUI ui ) {
|
||||
if ( ui == null ) {
|
||||
return;
|
||||
}
|
||||
if ( checkAMapView() ) {
|
||||
AMapNaviViewOptions options = mMapView.getViewOptions();
|
||||
if ( options == null ) {
|
||||
options = new AMapNaviViewOptions();
|
||||
}
|
||||
switch ( ui ) {
|
||||
case CarUp_2D:
|
||||
options.setTilt( 0 );
|
||||
mMapView.setNaviMode( AMapNaviView.CAR_UP_MODE );
|
||||
break;
|
||||
case CarUp_3D:
|
||||
options.setTilt( 60 );
|
||||
mMapView.setNaviMode( AMapNaviView.CAR_UP_MODE );
|
||||
break;
|
||||
case NorthUP_2D:
|
||||
options.setTilt( 0 );
|
||||
mMapView.setNaviMode( AMapNaviView.NORTH_UP_MODE );
|
||||
break;
|
||||
case Type_Light:
|
||||
if ( checkAMap() ) {
|
||||
mAMap.setMapType( AMap.MAP_TYPE_NORMAL );
|
||||
}
|
||||
return;
|
||||
case Type_Night:
|
||||
if ( checkAMap() ) {
|
||||
mAMap.setMapType( AMap.MAP_TYPE_NIGHT );
|
||||
}
|
||||
return;
|
||||
case Type_Navi:
|
||||
if ( checkAMap() ) {
|
||||
mAMap.setMapType( AMap.MAP_TYPE_NAVI );
|
||||
}
|
||||
return;
|
||||
}
|
||||
mMapView.setViewOptions( options );
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkAMap() {
|
||||
if ( mAMap == null ) {
|
||||
Logger.e( TAG, "高德map实例为空,请检查" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean checkAMapView() {
|
||||
if ( mMapView == null ) {
|
||||
Logger.e( TAG, "高德mapView实例为空,请检查" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToCurrentLocation() {
|
||||
MogoLocation location = ALocationClient.getInstance( getContext() ).getLastKnowLocation();
|
||||
if ( location != null ) {
|
||||
mAMap.animateCamera( CameraUpdateFactory.newLatLng( new LatLng( location.getLatitude(), location.getLongitude() ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
private Context getContext() {
|
||||
if ( checkAMapView() ) {
|
||||
return mMapView.getContext();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( boolean visible ) {
|
||||
if ( checkAMapView() ) {
|
||||
mAMap.setMyLocationEnabled( true );
|
||||
MyLocationStyle style = mAMap.getMyLocationStyle();
|
||||
style.showMyLocation( visible );
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromResource( R.drawable.ic_search_poi_location ) );
|
||||
mAMap.setMyLocationStyle( style );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recoverLockMode() {
|
||||
if ( checkAMapView() ) {
|
||||
mMapView.recoverLockMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview() {
|
||||
if ( checkAMapView() ) {
|
||||
mMapView.displayOverview();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-27
|
||||
* <p>
|
||||
* 操作拦截器
|
||||
*/
|
||||
public interface IInterceptor {
|
||||
|
||||
/**
|
||||
* 是否忽略添加多个marker时聚拢参数
|
||||
* <p>
|
||||
* 导航时:不需要聚拢
|
||||
*
|
||||
* @return true - 忽略 false - 不忽略
|
||||
*/
|
||||
boolean ignoreAddMarkersMoveToCenterParameters( Context context );
|
||||
|
||||
/**
|
||||
* 导航时,是否响应 poi 点击
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
boolean ignorePoiClickedWhenNaviing( Context context );
|
||||
|
||||
/**
|
||||
* 导航时,是否响应地图点击
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
boolean ignoreMapClickedWhenNaviing( Context context );
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.impl.amap.navi.NaviClient;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-27
|
||||
* <p>
|
||||
* 操作拦截器
|
||||
*/
|
||||
public class InterceptorHandler implements IInterceptor {
|
||||
|
||||
private static volatile InterceptorHandler sInstance;
|
||||
|
||||
private InterceptorHandler() {
|
||||
}
|
||||
|
||||
public static InterceptorHandler getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( InterceptorHandler.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new InterceptorHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ignoreAddMarkersMoveToCenterParameters( Context context ) {
|
||||
return NaviClient.getInstance( context ).isNaviing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ignorePoiClickedWhenNaviing( Context context ) {
|
||||
return NaviClient.getInstance( context ).isNaviing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean ignoreMapClickedWhenNaviing( Context context ) {
|
||||
return NaviClient.getInstance( context ).isNaviing();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.map.amap.location;
|
||||
package com.mogo.map.impl.amap.location;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -6,8 +6,8 @@ import com.amap.api.location.AMapLocation;
|
||||
import com.amap.api.location.AMapLocationClient;
|
||||
import com.amap.api.location.AMapLocationClientOption;
|
||||
import com.amap.api.location.AMapLocationListener;
|
||||
import com.mogo.map.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.location.ILocationListener;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.IMogoLocationClient;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -22,24 +22,25 @@ import java.util.Set;
|
||||
* <p>
|
||||
* 高德定位
|
||||
*/
|
||||
public class LocationClient implements IMogoLocationClient {
|
||||
public class ALocationClient implements IMogoLocationClient {
|
||||
|
||||
private static final String TAG = "LocationClient";
|
||||
|
||||
private static volatile LocationClient sInstance;
|
||||
private static Set< ILocationListener > sListeners = new HashSet<>( 10 );
|
||||
private static volatile ALocationClient sInstance;
|
||||
private static Set< IMogoLocationListener > sListeners = new HashSet<>( 10 );
|
||||
private static MogoLocation sLastLocation = new MogoLocation();
|
||||
|
||||
private LocationClient( Context context ) {
|
||||
private ALocationClient( Context context ) {
|
||||
mClient = new AMapLocationClient( context );
|
||||
mClient.setLocationListener( new InternalLocationListener() );
|
||||
sLastLocation = ObjectUtils.fromAMap( mClient.getLastKnownLocation() );
|
||||
}
|
||||
|
||||
public static LocationClient getInstance( Context context ) {
|
||||
public static ALocationClient getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( LocationClient.class ) {
|
||||
synchronized ( ALocationClient.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new LocationClient( context );
|
||||
sInstance = new ALocationClient( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +75,7 @@ public class LocationClient implements IMogoLocationClient {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLocationListener( ILocationListener listener ) {
|
||||
public void addLocationListener( IMogoLocationListener listener ) {
|
||||
if ( listener != null ) {
|
||||
synchronized ( sListeners ) {
|
||||
sListeners.add( listener );
|
||||
@@ -83,7 +84,7 @@ public class LocationClient implements IMogoLocationClient {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeLocationListener( ILocationListener listener ) {
|
||||
public void removeLocationListener( IMogoLocationListener listener ) {
|
||||
if ( listener != null ) {
|
||||
synchronized ( sListeners ) {
|
||||
sListeners.remove( listener );
|
||||
@@ -107,7 +108,7 @@ public class LocationClient implements IMogoLocationClient {
|
||||
Logger.d( TAG, aMapLocation.toString() );
|
||||
sLastLocation = ObjectUtils.fromAMap( aMapLocation );
|
||||
synchronized ( sListeners ) {
|
||||
Iterator< ILocationListener > listenerIterator = sListeners.iterator();
|
||||
Iterator< IMogoLocationListener > listenerIterator = sListeners.iterator();
|
||||
while ( listenerIterator.hasNext() ) {
|
||||
listenerIterator.next().onLocationChanged( sLastLocation.clone() );
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.map.amap.marker;
|
||||
package com.mogo.map.impl.amap.marker;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.map.amap.marker;
|
||||
package com.mogo.map.impl.amap.marker;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
@@ -8,11 +8,11 @@ import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.maps.model.Marker;
|
||||
import com.amap.api.maps.model.MarkerOptions;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.marker.IMogoInfoWindowAdapter;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.amap.utils.ObjectUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.ArrayList;
|
||||
* @author congtaowang
|
||||
* @since 2019-12-18
|
||||
* <p>
|
||||
* 代理高德marker
|
||||
* 高德marker
|
||||
*/
|
||||
public class AMapMarkerWrapper implements IMogoMarker {
|
||||
|
||||
@@ -31,11 +31,11 @@ public class AMapMarkerWrapper implements IMogoMarker {
|
||||
|
||||
private boolean mIsDestroy = false;
|
||||
|
||||
public AMapMarkerWrapper( Marker mMarker ) {
|
||||
this.mMarker = mMarker;
|
||||
if ( mMarker != null ) {
|
||||
public AMapMarkerWrapper( Marker marker ) {
|
||||
this.mMarker = marker;
|
||||
if ( marker != null ) {
|
||||
// 设置高德 marker 的object对象为 IMogoMarker 实例。!!!!
|
||||
mMarker.setObject( this );
|
||||
marker.setObject( this );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ public class AMapMarkerWrapper implements IMogoMarker {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setZIndex( float zIndex ) {
|
||||
public void setZIndex( int zIndex ) {
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setZIndex( zIndex );
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
package com.mogo.map.impl.amap.navi;
|
||||
|
||||
import com.amap.api.navi.AMapNaviListener;
|
||||
import com.amap.api.navi.model.AMapCalcRouteResult;
|
||||
import com.amap.api.navi.model.AMapLaneInfo;
|
||||
import com.amap.api.navi.model.AMapModelCross;
|
||||
import com.amap.api.navi.model.AMapNaviCameraInfo;
|
||||
import com.amap.api.navi.model.AMapNaviCross;
|
||||
import com.amap.api.navi.model.AMapNaviInfo;
|
||||
import com.amap.api.navi.model.AMapNaviLocation;
|
||||
import com.amap.api.navi.model.AMapNaviRouteNotifyData;
|
||||
import com.amap.api.navi.model.AMapNaviTrafficFacilityInfo;
|
||||
import com.amap.api.navi.model.AMapServiceAreaInfo;
|
||||
import com.amap.api.navi.model.AimLessModeCongestionInfo;
|
||||
import com.amap.api.navi.model.AimLessModeStat;
|
||||
import com.amap.api.navi.model.NaviInfo;
|
||||
import com.autonavi.tbt.TrafficFacilityInfo;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 高德导航事件:导航事件
|
||||
*/
|
||||
public abstract class AMapNaviListenerAdapter implements AMapNaviListener {
|
||||
|
||||
@Override
|
||||
public void onInitNaviFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitNaviSuccess() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartNavi( int i ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTrafficStatusUpdate() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChange( AMapNaviLocation aMapNaviLocation ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetNavigationText( int i, String s ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetNavigationText( String s ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEndEmulatorNavi() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArriveDestination() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateRouteFailure( int i ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReCalculateRouteForYaw() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReCalculateRouteForTrafficJam() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArrivedWayPoint( int i ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGpsOpenStatus( boolean b ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( NaviInfo naviInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdated( AMapNaviInfo aMapNaviInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCameraInfo( AMapNaviCameraInfo[] aMapNaviCameraInfos ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateIntervalCameraInfo( AMapNaviCameraInfo aMapNaviCameraInfo, AMapNaviCameraInfo aMapNaviCameraInfo1, int i ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceAreaUpdate( AMapServiceAreaInfo[] aMapServiceAreaInfos ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showCross( AMapNaviCross aMapNaviCross ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideCross() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showModeCross( AMapModelCross aMapModelCross ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideModeCross() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLaneInfo( AMapLaneInfo[] aMapLaneInfos, byte[] bytes, byte[] bytes1 ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showLaneInfo( AMapLaneInfo aMapLaneInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideLaneInfo() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateRouteSuccess( int[] ints ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyParallelRoad( int i ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void OnUpdateTrafficFacility( AMapNaviTrafficFacilityInfo[] aMapNaviTrafficFacilityInfos ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void OnUpdateTrafficFacility( AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void OnUpdateTrafficFacility( TrafficFacilityInfo trafficFacilityInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAimlessModeStatistics( AimLessModeStat aimLessModeStat ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAimlessModeCongestionInfo( AimLessModeCongestionInfo aimLessModeCongestionInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayRing( int i ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateRouteSuccess( AMapCalcRouteResult aMapCalcRouteResult ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateRouteFailure( AMapCalcRouteResult aMapCalcRouteResult ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviRouteNotify( AMapNaviRouteNotifyData aMapNaviRouteNotifyData ) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.mogo.map.impl.amap.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.amap.api.navi.model.AMapNaviPath;
|
||||
import com.amap.api.navi.model.AMapNaviStep;
|
||||
import com.mogo.map.impl.amap.overlay.RouteOverLayWrapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-04
|
||||
* <p>
|
||||
* 导航路径代理类
|
||||
*/
|
||||
public class CalculatePathItem {
|
||||
|
||||
private Context mContext;
|
||||
private AMap mAMap;
|
||||
private int mId;
|
||||
private AMapNaviPath mPath;
|
||||
|
||||
private RouteOverLayWrapper mOverLazWrapper;
|
||||
|
||||
public int getId() {
|
||||
return mId;
|
||||
}
|
||||
|
||||
public AMapNaviPath getPath() {
|
||||
return mPath;
|
||||
}
|
||||
|
||||
public RouteOverLayWrapper getOverLazWrapper( boolean createIfNull ) {
|
||||
if ( mOverLazWrapper == null && createIfNull ) {
|
||||
mOverLazWrapper = new RouteOverLayWrapper( mContext, mAMap, mPath );
|
||||
}
|
||||
return mOverLazWrapper;
|
||||
}
|
||||
|
||||
public CalculatePathItem( Context context, AMap amap, int id, AMapNaviPath path ) {
|
||||
mContext = context;
|
||||
mAMap = amap;
|
||||
this.mId = id;
|
||||
this.mPath = path;
|
||||
}
|
||||
|
||||
public String getStrategyName() {
|
||||
return mPath.getLabels();
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
if ( mTimeBuilder == null ) {
|
||||
final int time = mPath.getAllTime();
|
||||
mTimeBuilder = new StringBuilder();
|
||||
fillFormatTime( time, mTimeBuilder );
|
||||
}
|
||||
return mTimeBuilder.toString();
|
||||
}
|
||||
|
||||
private StringBuilder mTimeBuilder;
|
||||
|
||||
private void fillFormatTime( int seconds, StringBuilder builder ) {
|
||||
// int days = seconds / ( 24 * 60 * 60 );
|
||||
// if ( days > 0 ) {
|
||||
// builder.append( days ).append( "天" );
|
||||
// }
|
||||
// seconds -= days * 24 * 60 * 60;
|
||||
int hours = seconds / ( 60 * 60 );
|
||||
if ( hours > 0 ) {
|
||||
builder.append( hours ).append( "小时" );
|
||||
}
|
||||
seconds -= hours * 60 * 60;
|
||||
int min = seconds / 60;
|
||||
builder.append( min > 1 ? min : 1 ).append( "分钟" );
|
||||
}
|
||||
|
||||
private String mDistanceCacheStr = "";
|
||||
|
||||
public String getDistance() {
|
||||
if ( TextUtils.isEmpty( mDistanceCacheStr ) ) {
|
||||
int distance = mPath.getAllLength();
|
||||
if ( distance == -1 ) {
|
||||
mDistanceCacheStr = "路程总程未获取";
|
||||
}
|
||||
if ( distance >= 1000 ) {
|
||||
mDistanceCacheStr = String.format( "%.1f公里", ( float ) distance / 1000 );
|
||||
} else {
|
||||
mDistanceCacheStr = distance + "米";
|
||||
}
|
||||
}
|
||||
return mDistanceCacheStr;
|
||||
}
|
||||
|
||||
private StringBuilder mDescBuilder = null;
|
||||
|
||||
public String getDesc() {
|
||||
if ( mDescBuilder == null ) {
|
||||
mDescBuilder = new StringBuilder();
|
||||
int lightsSize = getTrafficNumber();
|
||||
if ( lightsSize > 0 ) {
|
||||
mDescBuilder.append( "红绿灯" ).append( lightsSize ).append( "个" );
|
||||
}
|
||||
mDescBuilder.append( " " );
|
||||
mDescBuilder.append( "收费" ).append( mPath.getTollCost() ).append( "元" );
|
||||
}
|
||||
|
||||
return mDescBuilder.toString();
|
||||
}
|
||||
|
||||
public int getTrafficNumber() {
|
||||
int trafficLightNumber = 0;
|
||||
if ( mPath == null ) {
|
||||
return trafficLightNumber;
|
||||
}
|
||||
List< AMapNaviStep > steps = mPath.getSteps();
|
||||
for ( AMapNaviStep step : steps ) {
|
||||
trafficLightNumber += step.getTrafficLightNumber();
|
||||
}
|
||||
return trafficLightNumber;
|
||||
}
|
||||
|
||||
public void release() {
|
||||
mContext = null;
|
||||
mAMap = null;
|
||||
mPath = null;
|
||||
if ( mOverLazWrapper != null ) {
|
||||
mOverLazWrapper.destroy();
|
||||
}
|
||||
mOverLazWrapper = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
package com.mogo.map.impl.amap.navi;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.navi.AMapNavi;
|
||||
import com.amap.api.navi.enums.NaviType;
|
||||
import com.amap.api.navi.model.NaviLatLng;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.navi.IMogoNavi;
|
||||
import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 高德导航
|
||||
*/
|
||||
public class NaviClient implements IMogoNavi {
|
||||
|
||||
private static final String TAG = "NaviClient";
|
||||
|
||||
private AMapNavi mAMapNavi;
|
||||
private final NaviListenerAdapter mAMapNaviListener;
|
||||
|
||||
/**
|
||||
* 导航策略配置
|
||||
*/
|
||||
private MogoNaviConfig mMogoNaviConfig = new MogoNaviConfig();
|
||||
|
||||
private static volatile NaviClient sInstance;
|
||||
|
||||
private NaviClient( Context context ) {
|
||||
mAMapNavi = AMapNavi.getInstance( context );
|
||||
mAMapNaviListener = new NaviListenerAdapter( context, mAMapNavi, this );
|
||||
mAMapNavi.addAMapNaviListener( mAMapNaviListener );
|
||||
}
|
||||
|
||||
public static NaviClient getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( NaviClient.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new NaviClient( context );
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint ) {
|
||||
naviTo( endPoint, mMogoNaviConfig );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, MogoNaviConfig config ) {
|
||||
naviTo( endPoint, null, config );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints ) {
|
||||
naviTo( endPoint, wayPoints, mMogoNaviConfig );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints, MogoNaviConfig config ) {
|
||||
if ( !checkAMapNavi() ) {
|
||||
return;
|
||||
}
|
||||
Logger.i( TAG, "开始规划路径" );
|
||||
mMogoNaviConfig = config;
|
||||
if ( mMogoNaviConfig == null ) {
|
||||
mMogoNaviConfig = new MogoNaviConfig();
|
||||
}
|
||||
int strategy = mAMapNavi.strategyConvert( mMogoNaviConfig.isCongestion(), mMogoNaviConfig.isAvoidSpeed(), mMogoNaviConfig.isCost(), mMogoNaviConfig.isHighSpeed(), config.isMultipleRoute() );
|
||||
List< NaviLatLng > naviWayPoints = null;
|
||||
if ( wayPoints != null && !wayPoints.isEmpty() ) {
|
||||
naviWayPoints = new ArrayList<>( wayPoints.size() );
|
||||
for ( MogoLatLng wayPoint : wayPoints ) {
|
||||
naviWayPoints.add( ObjectUtils.fromMogoAsNavi( wayPoint ) );
|
||||
}
|
||||
} else {
|
||||
naviWayPoints = new ArrayList<>();
|
||||
}
|
||||
mAMapNavi.calculateDriveRoute(
|
||||
new ArrayList( Arrays.asList( ObjectUtils.fromMogoAsNavi( endPoint ) ) ),
|
||||
naviWayPoints,
|
||||
strategy
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reCalculateRoute( MogoNaviConfig config ) {
|
||||
if ( !checkAMapNavi() ) {
|
||||
return;
|
||||
}
|
||||
mMogoNaviConfig = config;
|
||||
if ( mMogoNaviConfig == null ) {
|
||||
mMogoNaviConfig = new MogoNaviConfig();
|
||||
}
|
||||
int strategy = mAMapNavi.strategyConvert( mMogoNaviConfig.isCongestion(), mMogoNaviConfig.isAvoidSpeed(), mMogoNaviConfig.isCost(), mMogoNaviConfig.isHighSpeed(), config.isMultipleRoute() );
|
||||
mAMapNavi.reCalculateRoute( strategy );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopNavi() {
|
||||
if ( mAMapNaviListener != null ) {
|
||||
mAMapNaviListener.stopNavi();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startNavi() {
|
||||
if ( mAMapNaviListener.isStopped() ) {
|
||||
return;
|
||||
}
|
||||
mAMapNavi.startNavi( isRealNavi() ? NaviType.GPS : NaviType.EMULATOR );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaviing() {
|
||||
if ( mAMapNaviListener != null ) {
|
||||
return mAMapNaviListener.isNaviing();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// -- end
|
||||
|
||||
private boolean checkAMapNavi() {
|
||||
if ( mAMapNavi == null ) {
|
||||
Logger.e( TAG, "高德导航实例为空!!!" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isRealNavi() {
|
||||
if ( mMogoNaviConfig != null ) {
|
||||
return mMogoNaviConfig.isRealNavi();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void handleClickedPolyline( Polyline polyline ) {
|
||||
if ( mAMapNaviListener != null ) {
|
||||
mAMapNaviListener.handleClickedPolyline( polyline );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.mogo.map.impl.amap.navi;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.navi.AMapNavi;
|
||||
import com.amap.api.navi.enums.NaviType;
|
||||
import com.amap.api.navi.model.AMapCalcRouteResult;
|
||||
import com.amap.api.navi.model.NaviInfo;
|
||||
import com.mogo.map.impl.amap.AMapWrapper;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.navi.MogoNaviListenerHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-25
|
||||
* <p>
|
||||
* 高德导航回调
|
||||
*/
|
||||
public class NaviListenerAdapter extends AMapNaviListenerAdapter {
|
||||
|
||||
private static final String TAG = "NaviListenerAdapter";
|
||||
|
||||
private Context mContext;
|
||||
private AMapNavi mAMapNavi;
|
||||
private NaviClient mClient;
|
||||
/**
|
||||
* 导航状态:true - 导航 onStartNavi(int) 被调用, false - 到达目的地、手动挺固执
|
||||
*/
|
||||
private boolean mIsNaviing = false;
|
||||
|
||||
/**
|
||||
* 导航是否被停止:true - 手动停止或到达目的地、false - 规划路径成功、开启导航
|
||||
*/
|
||||
private boolean mIsStopped = true;
|
||||
|
||||
/**
|
||||
* 路线规划
|
||||
*/
|
||||
private NaviOverlayHelper mNaviOverlayHelper;
|
||||
|
||||
public NaviListenerAdapter( Context mContext, AMapNavi mAMapNavi, NaviClient client ) {
|
||||
this.mContext = mContext;
|
||||
this.mAMapNavi = mAMapNavi;
|
||||
this.mClient = client;
|
||||
mNaviOverlayHelper = new NaviOverlayHelper( mAMapNavi, AMapWrapper.getAMap(), mContext );
|
||||
}
|
||||
|
||||
public void setNaviing( boolean mIsNaviing ) {
|
||||
this.mIsNaviing = mIsNaviing;
|
||||
}
|
||||
|
||||
public boolean isNaviing() {
|
||||
return mIsNaviing;
|
||||
}
|
||||
|
||||
public void setStopped( boolean isStopped ) {
|
||||
this.mIsStopped = isStopped;
|
||||
}
|
||||
|
||||
public boolean isStopped() {
|
||||
return mIsStopped;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return mContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitNaviFailure() {
|
||||
MogoNaviListenerHandler.getInstance().onInitNaviFailure();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitNaviSuccess() {
|
||||
MogoNaviListenerHandler.getInstance().onInitNaviSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartNavi( int i ) {
|
||||
setStopped( false );
|
||||
setNaviing( true );
|
||||
if ( mAMapNavi != null ) {
|
||||
mAMapNavi.startSpeak();
|
||||
}
|
||||
MogoNaviListenerHandler.getInstance().onStartNavi();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEndEmulatorNavi() {
|
||||
setNaviing( false );
|
||||
setStopped( true );
|
||||
MogoNaviListenerHandler.getInstance().onStopNavi();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArriveDestination() {
|
||||
setNaviing( false );
|
||||
setStopped( true );
|
||||
MogoNaviListenerHandler.getInstance().onStopNavi();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( NaviInfo naviInfo ) {
|
||||
MogoNaviListenerHandler.getInstance().onNaviInfoUpdate( ObjectUtils.fromAMap( naviInfo ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateRouteFailure( AMapCalcRouteResult aMapCalcRouteResult ) {
|
||||
if ( aMapCalcRouteResult != null ) {
|
||||
Logger.i( TAG, PathPlanningErrorCodeConstants.getErrorMsg( aMapCalcRouteResult.getErrorCode() ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateRouteSuccess( AMapCalcRouteResult aMapCalcRouteResult ) {
|
||||
super.onCalculateRouteSuccess( aMapCalcRouteResult );
|
||||
Logger.i( TAG, "导航规划成功" );
|
||||
setStopped( false );
|
||||
mNaviOverlayHelper.showCalculatedPaths();
|
||||
}
|
||||
|
||||
public void stopNavi() {
|
||||
setStopped( true );
|
||||
setNaviing( false );
|
||||
mAMapNavi.stopNavi();
|
||||
MogoNaviListenerHandler.getInstance().onStopNavi();
|
||||
mNaviOverlayHelper.clearCalculatedOverlay();
|
||||
}
|
||||
|
||||
public void handleClickedPolyline( Polyline polyline ) {
|
||||
if ( mNaviOverlayHelper != null ) {
|
||||
mNaviOverlayHelper.handleClickedPolyline( polyline );
|
||||
if ( isNaviing() ) {
|
||||
mAMapNavi.stopNavi();
|
||||
mAMapNavi.selectRouteId( mNaviOverlayHelper.getSelectedPathId() );
|
||||
mAMapNavi.startNavi( mClient.isRealNavi() ? NaviType.GPS : NaviType.EMULATOR );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
package com.mogo.map.impl.amap.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.amap.api.maps.CameraUpdateFactory;
|
||||
import com.amap.api.maps.model.LatLngBounds;
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.navi.AMapNavi;
|
||||
import com.amap.api.navi.model.AMapNaviPath;
|
||||
import com.mogo.map.impl.amap.R;
|
||||
import com.mogo.map.impl.amap.overlay.RouteOverLayWrapper;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-27
|
||||
* <p>
|
||||
* 导航路径管理
|
||||
*/
|
||||
public class NaviOverlayHelper {
|
||||
|
||||
private static final String TAG = "NaviOverlayHelper";
|
||||
|
||||
/**
|
||||
* 选中的路径透明度
|
||||
*/
|
||||
public static final float AMAP_ROUTE_OVERLAY_TRANSPARENCY_SELECTED = 1f;
|
||||
|
||||
/**
|
||||
* 未选中的路径透明度
|
||||
*/
|
||||
public static final float AMAP_ROUTE_OVERLAY_TRANSPARENCY_UNSELECTED = 0.3f;
|
||||
|
||||
private AMapNavi mAMapNavi;
|
||||
private AMap mAMap;
|
||||
private Context mContext;
|
||||
// 规划的路线显示边距
|
||||
private Rect mBoundRect = null;
|
||||
|
||||
private List< CalculatePathItem > mCalculatePathItems;
|
||||
|
||||
private int mSelectedPathId;
|
||||
|
||||
public NaviOverlayHelper( AMapNavi mAMapNavi, AMap mAMap, Context mContext ) {
|
||||
this.mAMapNavi = mAMapNavi;
|
||||
this.mAMap = mAMap;
|
||||
this.mContext = mContext;
|
||||
calculateBoundArea();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示规划的路径
|
||||
*/
|
||||
public void showCalculatedPaths() {
|
||||
clearCalculatedOverlay();
|
||||
mCalculatePathItems = getSortedPaths();
|
||||
if ( mCalculatePathItems == null || mCalculatePathItems.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
showPathsBound( mCalculatePathItems.get( 0 ).getPath().getBoundsForPath() );
|
||||
renderPathOverlay( mCalculatePathItems );
|
||||
}
|
||||
|
||||
/**
|
||||
* 按pathId升序排序
|
||||
*
|
||||
* @return 排序好的路径规划列表
|
||||
*/
|
||||
private List< CalculatePathItem > getSortedPaths() {
|
||||
final Map< Integer, AMapNaviPath > pathMap = mAMapNavi.getNaviPaths();
|
||||
if ( pathMap == null || pathMap.isEmpty() ) {
|
||||
return null;
|
||||
}
|
||||
TreeMap< Integer, AMapNaviPath > sortedMap = new TreeMap< Integer, AMapNaviPath >( new Comparator< Integer >() {
|
||||
@Override
|
||||
public int compare( Integer obj1, Integer obj2 ) {
|
||||
if ( obj1 != null ) {
|
||||
return obj1.compareTo( obj2 );
|
||||
}
|
||||
if ( obj2 != null ) {
|
||||
return obj2.compareTo( obj1 );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
} );
|
||||
sortedMap.putAll( pathMap );
|
||||
|
||||
final List< CalculatePathItem > items = new ArrayList<>();
|
||||
for ( Map.Entry< Integer, AMapNaviPath > entry : sortedMap.entrySet() ) {
|
||||
if ( entry == null || entry.getKey() == null || entry.getValue() == null ) {
|
||||
continue;
|
||||
}
|
||||
items.add( new CalculatePathItem( mContext, mAMap, entry.getKey(), entry.getValue() ) );
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
private void calculateBoundArea() {
|
||||
if ( mBoundRect == null ) {
|
||||
mBoundRect = new Rect();
|
||||
final int padding = WindowUtils.dip2px( mContext, 80 );
|
||||
mBoundRect.left = padding;
|
||||
mBoundRect.right = padding;
|
||||
mBoundRect.top = padding;
|
||||
mBoundRect.bottom = padding;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将规划好的路径显示在视野内
|
||||
*
|
||||
* @param bounds
|
||||
*/
|
||||
private void showPathsBound( LatLngBounds bounds ) {
|
||||
mAMap.animateCamera( CameraUpdateFactory.newLatLngBoundsRect( bounds, mBoundRect.left, mBoundRect.right, mBoundRect.top, mBoundRect.bottom ) );
|
||||
}
|
||||
|
||||
public void renderPathOverlay( List< CalculatePathItem > paths ) {
|
||||
if ( paths == null || paths.size() == 0 ) {
|
||||
return;
|
||||
}
|
||||
for ( int i = 0; i < paths.size(); i++ ) {
|
||||
final CalculatePathItem item = paths.get( i );
|
||||
if ( item == null || item.getPath() == null ) {
|
||||
continue;
|
||||
}
|
||||
RouteOverLayWrapper wrapper = item.getOverLazWrapper( true );
|
||||
wrapper.setTrafficLightsVisible( false );
|
||||
// 默认选中第一个
|
||||
if ( i == 0 ) {
|
||||
wrapper.setStartBitmap( R.drawable.ic_amap_navi_cursor ).setEndBitmap( R.drawable.ic_search_choice_point );
|
||||
mAMapNavi.selectRouteId( item.getId() );
|
||||
}
|
||||
wrapper.addToMap();
|
||||
wrapper.setTransparency( i == 0 ? AMAP_ROUTE_OVERLAY_TRANSPARENCY_SELECTED : AMAP_ROUTE_OVERLAY_TRANSPARENCY_UNSELECTED );
|
||||
}
|
||||
}
|
||||
|
||||
public void clearCalculatedOverlay() {
|
||||
if ( mCalculatePathItems != null && !mCalculatePathItems.isEmpty() ) {
|
||||
for ( CalculatePathItem calculatePathItem : mCalculatePathItems ) {
|
||||
if ( calculatePathItem == null ) {
|
||||
continue;
|
||||
}
|
||||
RouteOverLayWrapper wrapper = calculatePathItem.getOverLazWrapper( false );
|
||||
if ( wrapper != null ) {
|
||||
wrapper.destroy();
|
||||
}
|
||||
}
|
||||
mCalculatePathItems.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否切换成功
|
||||
*
|
||||
* @param polyline 选中的线
|
||||
* @return
|
||||
*/
|
||||
public boolean handleClickedPolyline( Polyline polyline ) {
|
||||
if ( polyline == null ) {
|
||||
return false;
|
||||
}
|
||||
Logger.i( TAG, "polyline id = " + polyline.getId() );
|
||||
CalculatePathItem calculatePathItem = isCalculatePolyline( polyline );
|
||||
if ( calculatePathItem == null ) {
|
||||
return false;
|
||||
}
|
||||
mSelectedPathId = calculatePathItem.getId();
|
||||
if ( mCalculatePathItems != null ) {
|
||||
for ( CalculatePathItem item : mCalculatePathItems ) {
|
||||
final RouteOverLayWrapper wrapper = item.getOverLazWrapper( false );
|
||||
if ( wrapper == null ) {
|
||||
continue;
|
||||
}
|
||||
wrapper.setTransparency(
|
||||
item == calculatePathItem
|
||||
? AMAP_ROUTE_OVERLAY_TRANSPARENCY_SELECTED
|
||||
: AMAP_ROUTE_OVERLAY_TRANSPARENCY_UNSELECTED
|
||||
);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private CalculatePathItem isCalculatePolyline( Polyline polyline ) {
|
||||
CalculatePathItem result = null;
|
||||
if ( mCalculatePathItems == null || mCalculatePathItems.isEmpty() ) {
|
||||
return result;
|
||||
}
|
||||
for ( CalculatePathItem calculatePathItem : mCalculatePathItems ) {
|
||||
if ( calculatePathItem == null ) {
|
||||
continue;
|
||||
}
|
||||
final RouteOverLayWrapper wrapper = calculatePathItem.getOverLazWrapper( false );
|
||||
if ( wrapper == null ) {
|
||||
continue;
|
||||
}
|
||||
if ( wrapper.getTrafficColorfulPolyline() == null ) {
|
||||
continue;
|
||||
}
|
||||
if ( TextUtils.equals( wrapper.getTrafficColorfulPolyline().getId(), polyline.getId() )
|
||||
|| wrapper.getTrafficColorfulPolyline() == polyline ) {
|
||||
result = calculatePathItem;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int getSelectedPathId() {
|
||||
return mSelectedPathId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.mogo.map.impl.amap.navi;
|
||||
|
||||
import com.amap.api.navi.enums.PathPlanningErrCode;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-10-18
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public enum PathPlanningErrorCodeConstants {
|
||||
|
||||
NONE( -1, "路线规划错误,请重试" ),
|
||||
|
||||
ACCESS_TOO_FREQUENT( PathPlanningErrCode.ACCESS_TOO_FREQUENT, "访问过于频繁,请稍后再试" ),
|
||||
|
||||
DISABLE_RESTRICT( PathPlanningErrCode.DISABLE_RESTRICT, "无法躲避限行区域,请重新规划" ),
|
||||
|
||||
ERROR_BUF( PathPlanningErrCode.ERROR_BUF, "Buf数据格式错误" ),
|
||||
|
||||
ERROR_CONNECTION( PathPlanningErrCode.ERROR_CONNECTION, "网络超时或网络失败。" ),
|
||||
|
||||
ERROR_DISTANCE( PathPlanningErrCode.ERROR_DISTANCE, "起点/终点/途经点的距离太长(步行距离>100km,骑行距离>1200km)" ),
|
||||
|
||||
ERROR_ENCODER( PathPlanningErrCode.ERROR_ENCODER, "算路服务端编码失败" ),
|
||||
|
||||
ERROR_ENDPOINT( PathPlanningErrCode.ERROR_ENDPOINT, "终点错误" ),
|
||||
|
||||
ERROR_NAVI_PARAMS( PathPlanningErrCode.ERROR_NAVI_PARAMS, "调用直接导航 没有算路 参数错误,缺失有效的导航路径,无法开始导航" ),
|
||||
|
||||
ERROR_NOROADFORENDPOINT( PathPlanningErrCode.ERROR_NOROADFORENDPOINT, "终点没有找到道路" ),
|
||||
|
||||
ERROR_NOROADFORSTARTPOINT( PathPlanningErrCode.ERROR_NOROADFORSTARTPOINT, "起点没有找到道路。" ),
|
||||
|
||||
ERROR_NOROADFORWAYPOINT( PathPlanningErrCode.ERROR_NOROADFORWAYPOINT, "途径点没有找到道路" ),
|
||||
|
||||
ERROR_PREVIEW( PathPlanningErrCode.ERROR_PREVIEW, "路径数据缺乏预览数据" ),
|
||||
|
||||
ERROR_PROTOCOL( PathPlanningErrCode.ERROR_PROTOCOL, "请求协议非法。" ),
|
||||
|
||||
ERROR_STARTPOINT( PathPlanningErrCode.ERROR_STARTPOINT, "起点错误" ),
|
||||
|
||||
ERROR_WAYPOINT( PathPlanningErrCode.ERROR_WAYPOINT, "途经点错误" ),
|
||||
|
||||
INSUFFICIENT_PRIVILEGES( PathPlanningErrCode.INSUFFICIENT_PRIVILEGES, "无权限访问此服务。" ),
|
||||
|
||||
INVALID_PARAMS( PathPlanningErrCode.INVALID_PARAMS, "请求参数非法。" ),
|
||||
|
||||
INVALID_USER_KEY( PathPlanningErrCode.INVALID_USER_KEY, "用户key非法或过期(请检查key是否正确)" ),
|
||||
|
||||
INVALID_USER_SCODE( PathPlanningErrCode.INVALID_USER_SCODE, "MD5安全码未通过验证,需要开发者判定key绑定的SHA1,package是否与sdk包里的一致." ),
|
||||
|
||||
OUT_OF_SERVICE( PathPlanningErrCode.OUT_OF_SERVICE, "使用路径规划服务接口时可能出现该问题,规划点(包括起点、终点、途经点)不在中国陆地范围内" ),
|
||||
|
||||
OVER_DIRECTION_RANGE( PathPlanningErrCode.OVER_DIRECTION_RANGE, "使用路径规划服务接口时可能出现该问题,路线计算失败,通常是由于道路起点和终点距离过长导致" ),
|
||||
|
||||
OVER_QUOTA( PathPlanningErrCode.OVER_QUOTA, "请求超出配额。" ),
|
||||
|
||||
SERVICE_NOT_EXIST( PathPlanningErrCode.SERVICE_NOT_EXIST, "请求服务不存在。" ),
|
||||
|
||||
SERVICE_RESPONSE_ERROR( PathPlanningErrCode.SERVICE_RESPONSE_ERROR, "请求服务响应错误。" ),
|
||||
|
||||
UNKNOWN_ERROR( PathPlanningErrCode.UNKNOWN_ERROR, "未知错误(可能是由于连接的网络无法访问外网)" ),
|
||||
|
||||
USERKEY_PLAT_NOMATCH( PathPlanningErrCode.USERKEY_PLAT_NOMATCH, "请求中使用的key与绑定平台不符,例如:开发者申请的是js api的key,却用来调web服务接口" );
|
||||
|
||||
private int code;
|
||||
private String errorMsg;
|
||||
|
||||
PathPlanningErrorCodeConstants( int code, String errorMsg ) {
|
||||
this.code = code;
|
||||
this.errorMsg = errorMsg;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getErrorMsg() {
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
public static String getErrorMsg( int code ) {
|
||||
for ( PathPlanningErrorCodeConstants value : PathPlanningErrorCodeConstants.values() ) {
|
||||
if ( value.getCode() == code ) {
|
||||
return value.getErrorMsg();
|
||||
}
|
||||
}
|
||||
return NONE.getErrorMsg();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.mogo.map.impl.amap.overlay;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.util.Log;
|
||||
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.navi.model.AMapNaviLocation;
|
||||
import com.amap.api.navi.model.AMapNaviPath;
|
||||
import com.amap.api.navi.model.NaviInfo;
|
||||
import com.amap.api.navi.view.RouteOverLay;
|
||||
import com.mogo.map.impl.amap.utils.MapStyleUtils;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-10-04
|
||||
* <p>
|
||||
* 路径覆盖物
|
||||
*/
|
||||
public class RouteOverLayWrapper {
|
||||
|
||||
private static final String TAG = "RouteOverLayWrapper";
|
||||
|
||||
private final WeakReference< Context > mContextRef;
|
||||
private final AMap mAMap;
|
||||
private final AMapNaviPath mPath;
|
||||
|
||||
private RouteOverLay mRouteOverLay;
|
||||
private boolean mIsRemoved = true;
|
||||
|
||||
private boolean mIsTrafficLightsVisible = true;
|
||||
private int mStartBitmapResId = 0;
|
||||
private int mEndBitmapResId = 0;
|
||||
private int mZIndex = 0;
|
||||
|
||||
public RouteOverLayWrapper( Context context,
|
||||
AMap mAMap,
|
||||
AMapNaviPath mPath ) {
|
||||
this.mContextRef = new WeakReference<>( context );
|
||||
this.mAMap = mAMap;
|
||||
this.mPath = mPath;
|
||||
}
|
||||
|
||||
public void addToMap() {
|
||||
if ( mContextRef == null || mContextRef.get() == null ) {
|
||||
return;
|
||||
}
|
||||
mRouteOverLay = new RouteOverLay( mAMap, mPath, mContextRef.get() );
|
||||
mRouteOverLay.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() );
|
||||
mRouteOverLay.setTrafficLine( true );
|
||||
mRouteOverLay.setRouteOverlayVisible( true );
|
||||
mRouteOverLay.setTrafficLightsVisible( true );
|
||||
mRouteOverLay.setArrowOnRoute( true );
|
||||
mRouteOverLay.setZindex( mZIndex );
|
||||
mRouteOverLay.setNaviArrowVisible( true );
|
||||
mRouteOverLay.setLightsVisible( true );
|
||||
mRouteOverLay.setTrafficLightsVisible( mIsTrafficLightsVisible );
|
||||
|
||||
if ( mStartBitmapResId != 0 ) {
|
||||
try {
|
||||
mRouteOverLay.setStartPointBitmap( BitmapFactory.decodeResource( mContextRef.get().getResources(), mStartBitmapResId ) );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
mRouteOverLay.setStartPointBitmap( null );
|
||||
}
|
||||
|
||||
if ( mEndBitmapResId != 0 ) {
|
||||
try {
|
||||
mRouteOverLay.setEndPointBitmap( BitmapFactory.decodeResource( mContextRef.get().getResources(), mEndBitmapResId ) );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
mRouteOverLay.setEndPointBitmap( null );
|
||||
}
|
||||
|
||||
mRouteOverLay.addToMap();
|
||||
mIsRemoved = false;
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
Log.d( TAG, "remove" );
|
||||
if ( mRouteOverLay != null ) {
|
||||
try {
|
||||
mRouteOverLay.removeFromMap();
|
||||
mIsRemoved = true;
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置透明度
|
||||
*
|
||||
* @param alpha
|
||||
*/
|
||||
public void setTransparency( float alpha ) {
|
||||
if ( mRouteOverLay != null ) {
|
||||
mRouteOverLay.setTransparency( alpha );
|
||||
}
|
||||
}
|
||||
|
||||
public RouteOverLayWrapper setTrafficLightsVisible( boolean visible ) {
|
||||
mIsTrafficLightsVisible = visible;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RouteOverLayWrapper setStartBitmap( int startBitmapResId ) {
|
||||
mStartBitmapResId = startBitmapResId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RouteOverLayWrapper setEndBitmap( int endBitmapResId ) {
|
||||
mEndBitmapResId = endBitmapResId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RouteOverLayWrapper setZIndex( int zIndex ) {
|
||||
mZIndex = zIndex;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getZIndex() {
|
||||
return mZIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
super.finalize();
|
||||
mIsRemoved = true;
|
||||
}
|
||||
|
||||
public synchronized boolean isRemoved() {
|
||||
return mIsRemoved;
|
||||
}
|
||||
|
||||
public void updatePolyline( AMapNaviLocation aMapNaviLocation ) {
|
||||
Log.d( TAG, "updatePolyline" );
|
||||
if ( mIsRemoved ) {
|
||||
return;
|
||||
}
|
||||
if ( mRouteOverLay != null ) {
|
||||
mRouteOverLay.updatePolyline( aMapNaviLocation );
|
||||
}
|
||||
}
|
||||
|
||||
public void drawArrow( NaviInfo naviInfo ) {
|
||||
Log.d( TAG, "drawArrow" );
|
||||
if ( mIsRemoved ) {
|
||||
return;
|
||||
}
|
||||
if ( naviInfo == null ) {
|
||||
return;
|
||||
}
|
||||
if ( mRouteOverLay != null ) {
|
||||
try {
|
||||
mRouteOverLay.drawArrow( mRouteOverLay.getArrowPoints( naviInfo.getCurStep() ) );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Polyline getTrafficColorfulPolyline() {
|
||||
if ( mRouteOverLay != null ) {
|
||||
return mRouteOverLay.mTrafficColorfulPolyline;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
Log.d( TAG, "destroy" );
|
||||
if ( mRouteOverLay != null ) {
|
||||
try {
|
||||
mRouteOverLay.destroy();
|
||||
mIsRemoved = true;
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.map.amap.search;
|
||||
package com.mogo.map.impl.amap.search;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -8,8 +8,8 @@ import com.amap.api.services.geocoder.GeocodeResult;
|
||||
import com.amap.api.services.geocoder.GeocodeSearch;
|
||||
import com.amap.api.services.geocoder.RegeocodeAddress;
|
||||
import com.amap.api.services.geocoder.RegeocodeResult;
|
||||
import com.mogo.map.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearchListener;
|
||||
import com.mogo.map.search.geo.MogoGeocodeAddress;
|
||||
@@ -88,14 +88,20 @@ public class GeocodeSearchClient implements IMogoGeoSearch, GeocodeSearch.OnGeoc
|
||||
@Override
|
||||
public void onRegeocodeSearched( RegeocodeResult regeocodeResult, int i ) {
|
||||
if ( mListener != null ) {
|
||||
mListener.onRegeocodeSearched( ObjectUtils.fromAMap( regeocodeResult ), i );
|
||||
mListener.onRegeocodeSearched( ObjectUtils.fromAMap( regeocodeResult ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGeocodeSearched( GeocodeResult geocodeResult, int i ) {
|
||||
if ( mListener != null ) {
|
||||
mListener.onGeocodeSearched( ObjectUtils.fromAMap( geocodeResult ), i );
|
||||
mListener.onGeocodeSearched( ObjectUtils.fromAMap( geocodeResult ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mClient = null;
|
||||
mListener = null;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.map.amap.search;
|
||||
package com.mogo.map.impl.amap.search;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -6,12 +6,13 @@ import com.amap.api.services.core.AMapException;
|
||||
import com.amap.api.services.help.Inputtips;
|
||||
import com.amap.api.services.help.InputtipsQuery;
|
||||
import com.amap.api.services.help.Tip;
|
||||
import com.mogo.map.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.search.inputtips.IMogoInputtipsListener;
|
||||
import com.mogo.map.search.inputtips.IMogoInputtipsSearch;
|
||||
import com.mogo.map.search.inputtips.MogoTip;
|
||||
import com.mogo.map.search.inputtips.query.MogoInputtipsQuery;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -24,6 +25,8 @@ import java.util.List;
|
||||
*/
|
||||
public class InputtipsSearch implements IMogoInputtipsSearch, Inputtips.InputtipsListener {
|
||||
|
||||
private static final String TAG = "InputtipsSearch";
|
||||
|
||||
private Inputtips mClient;
|
||||
private InputtipsQuery mQuery;
|
||||
private IMogoInputtipsListener mListener;
|
||||
@@ -51,21 +54,14 @@ public class InputtipsSearch implements IMogoInputtipsSearch, Inputtips.Inputtip
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoTip > requestInputtips() throws MogoMapException {
|
||||
try {
|
||||
List< Tip > tips = mClient.requestInputtips();
|
||||
List< MogoTip > mogoTips = getResult( tips );
|
||||
return mogoTips;
|
||||
} catch ( AMapException e ) {
|
||||
throw new MogoMapException( e );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGetInputtips( List< Tip > list, int i ) {
|
||||
if ( mListener != null ) {
|
||||
mListener.onGetInputtips( getResult( list ), i );
|
||||
if ( i == 1000 ) {
|
||||
if ( mListener != null ) {
|
||||
mListener.onGetInputtips( getResult( list ) );
|
||||
}
|
||||
} else {
|
||||
Logger.e( TAG, "errorcode = " + i );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,4 +77,11 @@ public class InputtipsSearch implements IMogoInputtipsSearch, Inputtips.Inputtip
|
||||
}
|
||||
return mogoTips;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mClient = null;
|
||||
mListener = null;
|
||||
mQuery = null;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.map.amap.search;
|
||||
package com.mogo.map.impl.amap.search;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
@@ -6,8 +6,8 @@ import com.amap.api.services.core.AMapException;
|
||||
import com.amap.api.services.core.PoiItem;
|
||||
import com.amap.api.services.poisearch.PoiResult;
|
||||
import com.amap.api.services.poisearch.PoiSearch;
|
||||
import com.mogo.map.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.search.geo.MogoPoiItem;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearch;
|
||||
import com.mogo.map.search.poisearch.IMogoPoiSearchListener;
|
||||
@@ -96,7 +96,7 @@ public class PoiSearchClient implements IMogoPoiSearch, PoiSearch.OnPoiSearchLis
|
||||
public void setBound( MogoSearchBound bound ) {
|
||||
mBound = bound;
|
||||
if ( mClient != null ) {
|
||||
mClient.setBound( ObjectUtils.fromMogo( bound ) );
|
||||
mClient.setBound( ObjectUtils.fromMogo( mBound ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,4 +119,12 @@ public class PoiSearchClient implements IMogoPoiSearch, PoiSearch.OnPoiSearchLis
|
||||
mListener.onPoiItemSearched( ObjectUtils.fromAMap( poiItem ), errorCode );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mQuery = null;
|
||||
mClient = null;
|
||||
mListener = null;
|
||||
mBound = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.mogo.map.impl.amap.uicontroller;
|
||||
|
||||
import com.mogo.map.MogoMap;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-26
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
private static final String TAG = "AMapUIController";
|
||||
|
||||
private static volatile AMapUIController sInstance;
|
||||
|
||||
private IMogoMapUIController mClient;
|
||||
|
||||
private AMapUIController() {
|
||||
try {
|
||||
mClient = MogoMap.getInstance().getMogoMap().getUIController();
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, "获取UI控制实例失败", e );
|
||||
}
|
||||
}
|
||||
|
||||
public static AMapUIController getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( AMapUIController.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new AMapUIController();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnabled( boolean visible ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.setTrafficEnabled( visible );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom( boolean zoom ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.changeZoom( zoom );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMapMode( EnumMapUI mode ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.changeMapMode( mode );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToCurrentLocation() {
|
||||
if ( mClient != null ) {
|
||||
mClient.moveToCurrentLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( boolean visible ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.showMyLocation( visible );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recoverLockMode() {
|
||||
if ( mClient != null ) {
|
||||
mClient.recoverLockMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview() {
|
||||
if ( mClient != null ) {
|
||||
mClient.displayOverview();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.mogo.map.impl.amap.utils;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
|
||||
import com.amap.api.navi.model.RouteOverlayOptions;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-10-04
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MapStyleUtils {
|
||||
|
||||
enum ColorEnum {
|
||||
route_overlay_line_normal( Color.parseColor( "#7AD9B4" ) ),
|
||||
route_overlay_line_unknown( Color.parseColor( "#3CD26E" ) ),
|
||||
route_overlay_line_slow( Color.parseColor( "#EFCC7A" ) ),
|
||||
route_overlay_line_very_traffic( Color.parseColor( "#E16262" ) ),
|
||||
route_overlay_line_traffic( Color.parseColor( "#E88181" ) ),
|
||||
transparent( Color.parseColor( "#00000000" ) ),
|
||||
light_gray( Color.parseColor( "#CDD8FF" ) );
|
||||
|
||||
private int color;
|
||||
|
||||
ColorEnum( int color ) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
||||
public static RouteOverlayOptions getRouteOverlayOptions() {
|
||||
RouteOverlayOptions options = new RouteOverlayOptions();
|
||||
// 设置导航线路的宽度
|
||||
options.setLineWidth( 32 );
|
||||
// 设置交通状况情况良好下的纹理位图
|
||||
options.setSmoothTraffic( colorToBitmap( ColorEnum.route_overlay_line_normal.getColor() ) );
|
||||
// 设置路线的图标
|
||||
options.setNormalRoute( colorToBitmap( ColorEnum.route_overlay_line_normal.getColor() ) );
|
||||
// 设置交通状况未知下的纹理位图
|
||||
options.setUnknownTraffic( colorToBitmap( ColorEnum.route_overlay_line_unknown.getColor() ) );
|
||||
// 设置交通状况迟缓下的纹理位图
|
||||
options.setSlowTraffic( colorToBitmap( ColorEnum.route_overlay_line_slow.getColor() ) );
|
||||
// 设置交通状况非常拥堵下的纹理位图
|
||||
options.setVeryJamTraffic( colorToBitmap( ColorEnum.route_overlay_line_very_traffic.getColor() ) );
|
||||
// 设置交通状况拥堵下的纹理位图
|
||||
options.setJamTraffic( colorToBitmap( ColorEnum.route_overlay_line_traffic.getColor() ) );
|
||||
// 设置浮于道路上的『小箭头』图标的纹理位图
|
||||
options.setArrowOnTrafficRoute( colorToBitmap( ColorEnum.transparent.getColor() ) );
|
||||
// 自定义走过路线纹理,默认走过路线置灰功能为关,需要在AMapNaviViewOptions.setAfterRouteAutoGray(boolean)打开,该方法才生效
|
||||
options.setPassRoute( colorToBitmap( ColorEnum.light_gray.getColor() ) );
|
||||
// 设置路线虚线纹理
|
||||
options.setFairWayRes( colorToBitmap( ColorEnum.route_overlay_line_normal.getColor() ) );
|
||||
return options;
|
||||
}
|
||||
|
||||
public static Bitmap colorToBitmap( int color ) {
|
||||
Bitmap.Config config = Bitmap.Config.ARGB_8888;
|
||||
Bitmap bitmap = Bitmap.createBitmap( 1, 1, config );
|
||||
bitmap.eraseColor( color );
|
||||
return bitmap;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.map.amap.utils;
|
||||
package com.mogo.map.impl.amap.utils;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.amap.api.maps.model.BitmapDescriptorFactory;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.maps.model.MarkerOptions;
|
||||
import com.amap.api.maps.model.Poi;
|
||||
import com.amap.api.navi.model.NaviInfo;
|
||||
import com.amap.api.navi.model.NaviLatLng;
|
||||
import com.amap.api.services.core.LatLonPoint;
|
||||
import com.amap.api.services.core.PoiItem;
|
||||
import com.amap.api.services.geocoder.AoiItem;
|
||||
@@ -33,6 +35,7 @@ import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.search.geo.MogoAoiItem;
|
||||
import com.mogo.map.search.geo.MogoBusinessArea;
|
||||
import com.mogo.map.search.geo.MogoCrossroad;
|
||||
@@ -47,10 +50,10 @@ import com.mogo.map.search.geo.MogoRegeocodeResult;
|
||||
import com.mogo.map.search.geo.MogoRegeocodeRoad;
|
||||
import com.mogo.map.search.geo.MogoStreetNumber;
|
||||
import com.mogo.map.search.geo.MogoSubPoiItem;
|
||||
import com.mogo.map.search.inputtips.MogoTip;
|
||||
import com.mogo.map.search.geo.query.MogoGeocodeQuery;
|
||||
import com.mogo.map.search.inputtips.query.MogoInputtipsQuery;
|
||||
import com.mogo.map.search.geo.query.MogoRegeocodeQuery;
|
||||
import com.mogo.map.search.inputtips.MogoTip;
|
||||
import com.mogo.map.search.inputtips.query.MogoInputtipsQuery;
|
||||
import com.mogo.map.search.poisearch.MogoPoiResult;
|
||||
import com.mogo.map.search.poisearch.MogoSearchBound;
|
||||
import com.mogo.map.search.poisearch.query.MogoPoiSearchQuery;
|
||||
@@ -143,6 +146,13 @@ public class ObjectUtils {
|
||||
return new LatLonPoint( latLng.lat, latLng.lng );
|
||||
}
|
||||
|
||||
public static NaviLatLng fromMogoAsNavi( MogoLatLng latLng ) {
|
||||
if ( latLng == null ) {
|
||||
return null;
|
||||
}
|
||||
return new NaviLatLng( latLng.lat, latLng.lng );
|
||||
}
|
||||
|
||||
public static LatLng fromMogo2( MogoLatLng latLng ) {
|
||||
if ( latLng == null ) {
|
||||
return null;
|
||||
@@ -237,7 +247,7 @@ public class ObjectUtils {
|
||||
}
|
||||
|
||||
public static MogoGeocodeResult fromAMap( GeocodeResult result ) {
|
||||
if ( result == null || result.getGeocodeAddressList() != null ) {
|
||||
if ( result == null || result.getGeocodeAddressList() == null ) {
|
||||
return null;
|
||||
}
|
||||
MogoGeocodeResult mogoGeocodeResult = new MogoGeocodeResult();
|
||||
@@ -589,6 +599,21 @@ public class ObjectUtils {
|
||||
mogoPoiResult.setPois( mogoPoiItems );
|
||||
}
|
||||
return mogoPoiResult;
|
||||
}
|
||||
|
||||
public static MogoNaviInfo fromAMap( NaviInfo naviInfo ) {
|
||||
if ( naviInfo == null ) {
|
||||
return null;
|
||||
}
|
||||
MogoNaviInfo mogoNaviInfo = new MogoNaviInfo();
|
||||
mogoNaviInfo.setCurrentRoadName( naviInfo.getCurrentRoadName() );
|
||||
mogoNaviInfo.setCurrentSpeed( naviInfo.getCurrentSpeed() );
|
||||
mogoNaviInfo.setCurStepRetainDistance( naviInfo.getCurStepRetainDistance() );
|
||||
mogoNaviInfo.setCurStepRetainTime( naviInfo.getCurStepRetainTime() );
|
||||
mogoNaviInfo.setIconType( naviInfo.getIconType() );
|
||||
mogoNaviInfo.setNextRoadName( naviInfo.getNextRoadName() );
|
||||
mogoNaviInfo.setPathRetainDistance( naviInfo.getPathRetainDistance() );
|
||||
mogoNaviInfo.setPathRetainTime( naviInfo.getPathRetainTime() );
|
||||
return mogoNaviInfo;
|
||||
}
|
||||
}
|
||||
3
libraries/map-amap/src/main/res/values/strings.xml
Normal file
3
libraries/map-amap/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">map-amap</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals( 4, 2 + 2 );
|
||||
}
|
||||
}
|
||||
1
libraries/map-baidu/.gitignore
vendored
Normal file
1
libraries/map-baidu/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
58
libraries/map-baidu/build.gradle
Normal file
58
libraries/map-baidu/build.gradle
Normal file
@@ -0,0 +1,58 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion "29.0.2"
|
||||
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 29
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles 'consumer-rules.pro'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
jniLibs.srcDirs = ['libs']
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
task copyLibs(type: Copy) {
|
||||
from configurations.compile
|
||||
into 'libs'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
|
||||
implementation project(':foudations:mogo-utils')
|
||||
implementation project(':libraries:mogo-map-api')
|
||||
|
||||
implementation(name: 'onsdk_all', ext: 'aar') {
|
||||
transitive = true
|
||||
}
|
||||
implementation(name: 'NaviTts', ext: 'aar') {
|
||||
transitive = true
|
||||
}
|
||||
}
|
||||
0
libraries/map-baidu/consumer-rules.pro
Normal file
0
libraries/map-baidu/consumer-rules.pro
Normal file
BIN
libraries/map-baidu/libs/BaiduLBS_Android.jar
Normal file
BIN
libraries/map-baidu/libs/BaiduLBS_Android.jar
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/NaviTts.aar
Normal file
BIN
libraries/map-baidu/libs/NaviTts.aar
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libBDSpeechDecoder_V1.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libBDSpeechDecoder_V1.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libBaiduMapSDK_base_v6_1_0.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libBaiduMapSDK_base_v6_1_0.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libBaiduMapSDK_map_v6_1_0.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libBaiduMapSDK_map_v6_1_0.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libaime.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libaime.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libapp_BaiduMapApplib.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libapp_BaiduMapApplib.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libapp_BaiduMapBaselib.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libapp_BaiduMapBaselib.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libapp_BaiduNaviApplib.so
Executable file
BIN
libraries/map-baidu/libs/arm64-v8a/libapp_BaiduNaviApplib.so
Executable file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libapp_BaiduVIlib.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libapp_BaiduVIlib.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libbd_etts.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libbd_etts.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libcrypto.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libcrypto.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libgnustl_shared.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libgnustl_shared.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libindoor.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libindoor.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/liblocSDK8a.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/liblocSDK8a.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libmpcr.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libmpcr.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/arm64-v8a/libssl.so
Normal file
BIN
libraries/map-baidu/libs/arm64-v8a/libssl.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libBDSpeechDecoder_V1.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libBDSpeechDecoder_V1.so
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libaime.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libaime.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libapp_BaiduMapApplib.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libapp_BaiduMapApplib.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libapp_BaiduMapBaselib.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libapp_BaiduMapBaselib.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libapp_BaiduNaviApplib.so
Executable file
BIN
libraries/map-baidu/libs/armeabi-v7a/libapp_BaiduNaviApplib.so
Executable file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libapp_BaiduVIlib.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libapp_BaiduVIlib.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libbd_etts.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libbd_etts.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libcrypto.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libcrypto.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libgnustl_shared.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libgnustl_shared.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libindoor.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libindoor.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/liblocSDK8a.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/liblocSDK8a.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libmpcr.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libmpcr.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi-v7a/libssl.so
Normal file
BIN
libraries/map-baidu/libs/armeabi-v7a/libssl.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libBDSpeechDecoder_V1.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libBDSpeechDecoder_V1.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libBaiduMapSDK_base_v6_1_0.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libBaiduMapSDK_base_v6_1_0.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libBaiduMapSDK_map_v6_1_0.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libBaiduMapSDK_map_v6_1_0.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libaime.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libaime.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libapp_BaiduMapApplib.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libapp_BaiduMapApplib.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libapp_BaiduMapBaselib.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libapp_BaiduMapBaselib.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libapp_BaiduNaviApplib.so
Executable file
BIN
libraries/map-baidu/libs/armeabi/libapp_BaiduNaviApplib.so
Executable file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libapp_BaiduVIlib.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libapp_BaiduVIlib.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libbd_etts.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libbd_etts.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libcrypto.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libcrypto.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libgnustl_shared.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libgnustl_shared.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libindoor.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libindoor.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/liblocSDK8a.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/liblocSDK8a.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libmpcr.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libmpcr.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/armeabi/libssl.so
Normal file
BIN
libraries/map-baidu/libs/armeabi/libssl.so
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/galaxy_lite_v2.3.jar
Executable file
BIN
libraries/map-baidu/libs/galaxy_lite_v2.3.jar
Executable file
Binary file not shown.
BIN
libraries/map-baidu/libs/intellij_annotations.jar
Executable file
BIN
libraries/map-baidu/libs/intellij_annotations.jar
Executable file
Binary file not shown.
BIN
libraries/map-baidu/libs/javapoet-1.9.0.jar
Executable file
BIN
libraries/map-baidu/libs/javapoet-1.9.0.jar
Executable file
Binary file not shown.
BIN
libraries/map-baidu/libs/onsdk_all.aar
Normal file
BIN
libraries/map-baidu/libs/onsdk_all.aar
Normal file
Binary file not shown.
BIN
libraries/map-baidu/libs/protobuf-java-2.3.0-micro.jar
Executable file
BIN
libraries/map-baidu/libs/protobuf-java-2.3.0-micro.jar
Executable file
Binary file not shown.
BIN
libraries/map-baidu/libs/req_head.jar
Executable file
BIN
libraries/map-baidu/libs/req_head.jar
Executable file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user