replace AMapNaviView
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.mogo.connection;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
||||
public static final String LIBRARY_PACKAGE_NAME = "com.mogo.connection";
|
||||
/**
|
||||
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String APPLICATION_ID = "com.mogo.connection";
|
||||
public static final String BUILD_TYPE = "debug";
|
||||
public static final String FLAVOR = "";
|
||||
public static final int VERSION_CODE = 1;
|
||||
public static final String VERSION_NAME = "1.2.1.9";
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.connection"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.2.1.9" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="22" />
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1 @@
|
||||
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.2.1.9","enabled":true,"outputFile":"mogo-connection-debug.aar","fullName":"debug","baseName":"debug"},"path":"AndroidManifest.xml","properties":{"packageId":"com.mogo.connection","split":""}}]
|
||||
@@ -0,0 +1 @@
|
||||
{"jetified-arouter-compiler-1.2.2.jar (com.alibaba:arouter-compiler:1.2.2)":false,"auto-service-1.0-rc2.jar (com.google.auto.service:auto-service:1.0-rc2)":false}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/debug/jniLibs"/></dataSet></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/debug/shaders"/></dataSet></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/assets"/><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/debug/assets"/></dataSet></merger>
|
||||
@@ -0,0 +1 @@
|
||||
#Wed Aug 26 14:14:57 CST 2020
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">mogo-connection</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/res"/><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/build/generated/res/rs/debug"/><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/res"><file path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/res/values/strings.xml" qualifiers=""><string name="app_name">mogo-connection</string></file></source><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/build/generated/res/rs/debug"/><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/debug/res"/></dataSet><mergedItems/></merger>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.connection"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.2.1.9" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="22" />
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,3 @@
|
||||
R_DEF: Internal format may change without notice
|
||||
local
|
||||
string app_name
|
||||
@@ -0,0 +1,13 @@
|
||||
1<?xml version="1.0" encoding="utf-8"?>
|
||||
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
3 package="com.mogo.connection"
|
||||
4 android:versionCode="1"
|
||||
5 android:versionName="1.2.1.9" >
|
||||
6
|
||||
7 <uses-sdk
|
||||
8 android:minSdkVersion="19"
|
||||
8-->/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
9 android:targetSdkVersion="22" />
|
||||
9-->/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
10
|
||||
11</manifest>
|
||||
@@ -0,0 +1 @@
|
||||
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.2.1.9","enabled":true,"outputFile":"mogo-connection-debug.aar","fullName":"debug","baseName":"debug"},"path":"../../library_manifest/debug/AndroidManifest.xml","properties":{"packageId":"com.mogo.connection","split":""}}]
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">mogo-connection</string>
|
||||
</resources>
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
1712
foudations/mogo-connection/build/intermediates/symbols/debug/R.txt
Normal file
1712
foudations/mogo-connection/build/intermediates/symbols/debug/R.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
||||
-- Merging decision tree log ---
|
||||
manifest
|
||||
ADDED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:1:1-2:37
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:1:1-2:37
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:1:1-2:37
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:1:1-2:37
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:1:1-2:37
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:1:1-2:37
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:1:1-2:37
|
||||
package
|
||||
ADDED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:2:5-34
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
android:versionName
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:1:1-2:37
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
android:versionCode
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:1:1-2:37
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
xmlns:android
|
||||
ADDED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml:1:11-69
|
||||
uses-sdk
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml reason: use-sdk injection requested
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
android:targetSdkVersion
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
android:minSdkVersion
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
ADDED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
INJECTED from /Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/foudations/mogo-connection/src/main/AndroidManifest.xml
|
||||
@@ -5,7 +5,9 @@ import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.amap.api.maps.MapView;
|
||||
import com.amap.api.navi.AMapNaviView;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.MogoBaseMapView;
|
||||
|
||||
@@ -31,6 +33,9 @@ public class AMapBaseMapView extends MogoBaseMapView {
|
||||
|
||||
@Override
|
||||
protected IMogoMapView createMapView( Context context ) {
|
||||
if ( DebugConfig.getCarMachineType() != DebugConfig.CAR_MACHINE_TYPE_BYD ) {
|
||||
return new AMapViewWrapper( new MapView( context ) );
|
||||
}
|
||||
return new AMapNaviViewWrapper( new AMapNaviView( context ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
|
||||
public AMapNaviViewWrapper( AMapNaviView mapView ) {
|
||||
this.mMapView = mapView;
|
||||
this.mIMap = new AMapWrapper( mMapView.getMap(), mMapView, this );
|
||||
this.mIMap = new AMapWrapper( mMapView.getMap(), mMapView.getContext(), this );
|
||||
try {
|
||||
new BnHooker( mMapView.getMap(), mapView.getContext() );
|
||||
} catch ( Exception e ) {
|
||||
|
||||
@@ -0,0 +1,890 @@
|
||||
package com.mogo.map.impl.amap;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemClock;
|
||||
import android.os.Trace;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import com.amap.api.maps.AMap;
|
||||
import com.amap.api.maps.AMapUtils;
|
||||
import com.amap.api.maps.CameraUpdateFactory;
|
||||
import com.amap.api.maps.MapView;
|
||||
import com.amap.api.maps.model.BitmapDescriptorFactory;
|
||||
import com.amap.api.maps.model.CameraPosition;
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.maps.model.LatLngBounds;
|
||||
import com.amap.api.maps.model.Marker;
|
||||
import com.amap.api.maps.model.MyLocationStyle;
|
||||
import com.amap.api.maps.model.Poi;
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.maps.model.animation.Animation;
|
||||
import com.amap.api.maps.model.animation.TranslateAnimation;
|
||||
import com.amap.api.navi.AMapNaviViewListener;
|
||||
import com.amap.api.navi.AMapNaviViewOptions;
|
||||
import com.amap.api.navi.model.NaviInfo;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoMapView;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.impl.amap.hook.BnHooker;
|
||||
import com.mogo.map.impl.amap.marker.AMapMarkerWrapper;
|
||||
import com.mogo.map.impl.amap.message.AMapMessageListener;
|
||||
import com.mogo.map.impl.amap.message.AMapMessageManager;
|
||||
import com.mogo.map.impl.amap.navi.NaviClient;
|
||||
import com.mogo.map.impl.amap.utils.MogoMapUtils;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-18
|
||||
* <p>
|
||||
* 代理高德导航地图
|
||||
*/
|
||||
public class AMapViewWrapper implements IMogoMapView,
|
||||
IMogoMapUIController,
|
||||
AMap.OnMarkerClickListener,
|
||||
AMap.OnMapLoadedListener,
|
||||
AMap.OnMapTouchListener,
|
||||
AMap.OnPOIClickListener,
|
||||
AMap.OnMapClickListener,
|
||||
AMap.OnPolylineClickListener,
|
||||
AMapNaviViewListener,
|
||||
AMapMessageListener,
|
||||
AMap.OnCameraChangeListener,
|
||||
AMap.OnMyLocationChangeListener {
|
||||
|
||||
private static final String TAG = "AMapNaviViewWrapper";
|
||||
|
||||
private final MapView mMapView;
|
||||
private IMogoMap mIMap;
|
||||
|
||||
private AMapMarkerClickHandler mMarkerClickHandler;
|
||||
private EnumMapUI mCurrentUIMode;
|
||||
|
||||
private boolean mIsCarLocked = false;
|
||||
|
||||
private float mDefaultZoomLevel = 16.0f;
|
||||
private final CarCursorOption DEFAULT_OPTION = new CarCursorOption.Builder()
|
||||
.carCursorRes( R.drawable.map_api_ic_current_location2 )
|
||||
.naviCursorRes( R.drawable.ic_amap_navi_cursor )
|
||||
.build();
|
||||
private CarCursorOption mCarCursorOption = DEFAULT_OPTION;
|
||||
|
||||
public AMapViewWrapper( MapView mapView ) {
|
||||
this.mMapView = mapView;
|
||||
this.mIMap = new AMapWrapper( mMapView.getMap(), mMapView.getContext(), this );
|
||||
try {
|
||||
new BnHooker( mMapView.getMap(), mapView.getContext() );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void initMapView() {
|
||||
if ( mMapView == null ) {
|
||||
return;
|
||||
}
|
||||
// AMapNaviViewOptions options = mMapView.getViewOptions();
|
||||
// if ( options != null ) {
|
||||
// // 设置是否开启自动黑夜模式切换,默认为false,不自动切换
|
||||
// options.setAutoNaviViewNightMode( false );
|
||||
// // 设置6秒后是否自动锁车
|
||||
// options.setAutoLockCar( false );
|
||||
// // 设置路线上的摄像头气泡是否显示
|
||||
// options.setCameraBubbleShow( true );
|
||||
// // 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。
|
||||
// // options.setRouteOverlayOptions( MapStyleUtils.getRouteOverlayOptions() );
|
||||
// // 设置自车的图片对象
|
||||
// options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), DEFAULT_OPTION.getNaviCursorRes() ) );
|
||||
// // 设置指南针图标否在导航界面显示,默认显示。true,显示;false,隐藏。
|
||||
// options.setCompassEnabled( false );
|
||||
// // 黑夜模式
|
||||
// options.setNaviNight( true );
|
||||
// //设置路况光柱条是否显示(只适用于驾车导航,需要联网)。
|
||||
// options.setTrafficBarEnabled( false );
|
||||
// // 设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。
|
||||
// options.setTrafficLayerEnabled( false );
|
||||
// // 设置导航界面是否显示路线全览按钮。
|
||||
// options.setRouteListButtonShow( false );
|
||||
// // 设置屏幕是否常亮,默认开启
|
||||
// options.setScreenAlwaysBright( false );
|
||||
// // 设置交通播报是否打开(只适用于驾车导航,需要联网)。
|
||||
// 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.setZoom( ( ( int ) mDefaultZoomLevel ) );
|
||||
// options.setPointToCenter( 0.7D, 0.5D );
|
||||
// // 2D模式
|
||||
// options.setTilt( 0 );
|
||||
// mMapView.setViewOptions( options );
|
||||
// }
|
||||
// mMapView.setRouteOverlayVisible( false );
|
||||
// mMapView.setCarOverlayVisible( false );
|
||||
setUIMode( EnumMapUI.CarUp_2D, null );
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
|
||||
mMarkerClickHandler = new AMapMarkerClickHandler();
|
||||
final AMap aMap = mMapView.getMap();
|
||||
if ( aMap != null ) {
|
||||
aMap.setOnMarkerClickListener( this );
|
||||
aMap.setOnMapLoadedListener( this );
|
||||
aMap.setOnMapTouchListener( this );
|
||||
aMap.setOnPolylineClickListener( this );
|
||||
// aMap.setAMapNaviViewListener( this );
|
||||
aMap.setOnCameraChangeListener( this );
|
||||
aMap.setOnPOIClickListener( this );
|
||||
aMap.setOnMapClickListener( this );
|
||||
aMap.setOnCameraChangeListener( this );
|
||||
aMap.setOnMyLocationChangeListener( this );
|
||||
}
|
||||
AMapMessageManager.getInstance().registerAMapMessageListener( 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 );
|
||||
Logger.d( TAG, "map onCreate" );
|
||||
initMapView();
|
||||
initListeners();
|
||||
initMyLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onResume();
|
||||
Logger.d( TAG, "map onResume" );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onPause();
|
||||
Logger.d( TAG, "map onPause" );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onDestroy();
|
||||
Logger.d( TAG, "map onDestroy" );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState( Bundle outState ) {
|
||||
if ( mMapView != null ) {
|
||||
mMapView.onSaveInstanceState( outState );
|
||||
Logger.d( TAG, "map onSaveInstanceState" );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
Logger.d( TAG, "map onLowMemory" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图marker点击
|
||||
*/
|
||||
@Override
|
||||
public boolean onMarkerClick( Marker marker ) {
|
||||
return mMarkerClickHandler.handleMarkerClicked( marker );
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图加载完毕
|
||||
*/
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
MogoMapListenerHandler.getInstance().onMapLoaded();
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图点击回调
|
||||
*/
|
||||
@Override
|
||||
public void onTouch( MotionEvent motionEvent ) {
|
||||
MogoMapListenerHandler.getInstance().onTouch( motionEvent );
|
||||
if ( mIsCarLocked ) {
|
||||
loseLockMode();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* POI 点击
|
||||
*/
|
||||
@Override
|
||||
public void onPOIClick( Poi poi ) {
|
||||
if ( InterceptorHandler.getInstance().ignorePoiClicked( getContext() ) ) {
|
||||
return;
|
||||
}
|
||||
MogoMapListenerHandler.getInstance().onPOIClick( ObjectUtils.fromAMap( poi ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick( LatLng latLng ) {
|
||||
if ( InterceptorHandler.getInstance().ignoreMapClicked( getContext() ) ) {
|
||||
return;
|
||||
}
|
||||
MogoMapListenerHandler.getInstance().onMapClick( ObjectUtils.fromAMap( latLng ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPolylineClick( Polyline polyline ) {
|
||||
if ( !NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
NaviClient.getInstance( getContext() ).handleClickedPolyline( polyline );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviSetting() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviCancel() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNaviBackClick() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mode 0:车头朝上状态;1:正北朝上模式
|
||||
*/
|
||||
@Override
|
||||
public void onNaviMapMode( int mode ) {
|
||||
Logger.i( TAG, "mode=" + mode );
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged( mode == 0 ? EnumMapUI.CarUp_2D : EnumMapUI.NorthUP_2D );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviTurnClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNextRoadClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScanViewButtonClick() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap( boolean isLock ) {
|
||||
Logger.d( TAG, "lock status = %s", isLock );
|
||||
mIsCarLocked = isLock;
|
||||
Trace.beginSection( "timer.onCameraChangeFinish" );
|
||||
MogoMapListenerHandler.getInstance().onLockMap( isLock );
|
||||
Trace.endSection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviViewLoaded() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapTypeChanged( int type ) {
|
||||
if ( type == 4 ) {
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged( EnumMapUI.Type_Light );
|
||||
} else if ( type == 3 ) {
|
||||
MogoMapListenerHandler.getInstance().onMapModeChanged( EnumMapUI.Type_Night );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviViewShowMode( int i ) {
|
||||
|
||||
// long delay = mMapView.getViewOptions().getLockMapDelayed();
|
||||
// switch ( i ) {
|
||||
// case AMapNaviViewShowMode.SHOW_MODE_DEFAULT:
|
||||
// Logger.d( TAG, "普通模式" );
|
||||
// break;
|
||||
// case AMapNaviViewShowMode.SHOW_MODE_DISPLAY_OVERVIEW:
|
||||
// Logger.d( TAG, "全览模式" );
|
||||
// break;
|
||||
// case AMapNaviViewShowMode.SHOW_MODE_LOCK_CAR:
|
||||
// Logger.d( TAG, "锁车模式: %s", delay );
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnabled( boolean visible ) {
|
||||
if ( checkMapView() ) {
|
||||
mMapView.getMap().setTrafficEnabled( true );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom( boolean zoom ) {
|
||||
if ( checkMapView() ) {
|
||||
mDefaultZoomLevel = ( int ) ( getMap().getZoomLevel() + 0.5f );
|
||||
|
||||
if ( zoom ) {
|
||||
if ( mDefaultZoomLevel >= 20 ) {
|
||||
return MapControlResult.TARGET;
|
||||
}
|
||||
} else {
|
||||
if ( mDefaultZoomLevel <= 3 ) {
|
||||
return MapControlResult.TARGET;
|
||||
}
|
||||
}
|
||||
|
||||
if ( zoom ) {
|
||||
mDefaultZoomLevel += 2f;
|
||||
if ( mDefaultZoomLevel > 20 ) {
|
||||
mDefaultZoomLevel = 20;
|
||||
}
|
||||
} else {
|
||||
mDefaultZoomLevel -= 2f;
|
||||
if ( mDefaultZoomLevel < 1 ) {
|
||||
mDefaultZoomLevel = 1;
|
||||
}
|
||||
}
|
||||
changeZoom( ( int ) mDefaultZoomLevel );
|
||||
}
|
||||
return MapControlResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom( float zoom ) {
|
||||
Logger.d( TAG, "changeZoom %s", zoom );
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
getMap().changeZoom( zoom );
|
||||
return MapControlResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMapMode( EnumMapUI ui ) {
|
||||
if ( ui == null ) {
|
||||
return;
|
||||
}
|
||||
if ( checkMapView() ) {
|
||||
// AMapNaviViewOptions options = mMapView.getViewOptions();
|
||||
// if ( options == null ) {
|
||||
// options = new AMapNaviViewOptions();
|
||||
// }
|
||||
// switch ( ui ) {
|
||||
// case CarUp_2D:
|
||||
// case CarUp_3D:
|
||||
// case NorthUP_2D:
|
||||
// setUIMode( ui, options );
|
||||
// break;
|
||||
// case Type_Light:
|
||||
// mMapView.getMap().setMapType( MapType );
|
||||
// options.setNaviNight( false );
|
||||
// break;
|
||||
// case Type_Night:
|
||||
// options.setNaviNight( true );
|
||||
// break;
|
||||
// case Type_AUTO_LIGHT_Night:
|
||||
// options.setNaviNight( false );
|
||||
// options.setAutoNaviViewNightMode( true );
|
||||
// break;
|
||||
// }
|
||||
// mMapView.setViewOptions( options );
|
||||
}
|
||||
}
|
||||
|
||||
private void setUIMode( EnumMapUI ui, AMapNaviViewOptions options ) {
|
||||
this.mCurrentUIMode = ui;
|
||||
switch ( ui ) {
|
||||
case CarUp_2D:
|
||||
case CarUp_3D:
|
||||
// mMapView.setNaviMode( AMapNaviView.CAR_UP_MODE );
|
||||
break;
|
||||
case NorthUP_2D:
|
||||
// mMapView.setNaviMode( AMapNaviView.NORTH_UP_MODE );
|
||||
break;
|
||||
}
|
||||
|
||||
Logger.d( TAG, "mCurrentUIMode--->" + mCurrentUIMode.name() );
|
||||
if ( options == null ) {
|
||||
return;
|
||||
}
|
||||
switch ( ui ) {
|
||||
case CarUp_2D:
|
||||
case NorthUP_2D:
|
||||
options.setTilt( 0 );
|
||||
break;
|
||||
case CarUp_3D:
|
||||
options.setTilt( 60 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkMapView() {
|
||||
if ( mMapView == null ) {
|
||||
Logger.e( TAG, "高德mapView实例为空,请检查" );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToCenter( MogoLatLng latLng, boolean animate ) {
|
||||
Logger.d( TAG, "move to center %s", latLng );
|
||||
if ( latLng == null || latLng.lat == 0.0d || latLng.lng == 0.0d ) {
|
||||
Logger.e( TAG, "latlng = null or is illegal" );
|
||||
return;
|
||||
}
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
loseLockMode();
|
||||
if ( animate ) {
|
||||
mMapView.getMap().animateCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) );
|
||||
} else {
|
||||
mMapView.getMap().moveCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( boolean visible ) {
|
||||
Logger.d( TAG, "showMyLocation1 %s", visible );
|
||||
if ( visible && NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
return;
|
||||
}
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
if ( checkMapView() ) {
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
if ( style == null ) {
|
||||
style = new MyLocationStyle();
|
||||
}
|
||||
style.showMyLocation( visible );
|
||||
if ( visible ) {
|
||||
// 强制刷新一遍车标
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) );
|
||||
}
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( View view ) {
|
||||
if ( NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
return;
|
||||
}
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
if ( checkMapView() ) {
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
if ( style == null ) {
|
||||
style = new MyLocationStyle();
|
||||
}
|
||||
style.showMyLocation( true );
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromView( view ) );
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
}
|
||||
}
|
||||
|
||||
public void initMyLocation() {
|
||||
if ( checkMapView() ) {
|
||||
mMapView.getMap().setMyLocationEnabled( true );
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER );
|
||||
style.interval( 1000 );
|
||||
style.anchor( 0.5F, 0.5F );
|
||||
style.strokeColor( Color.TRANSPARENT );
|
||||
style.strokeWidth( 0 );
|
||||
style.radiusFillColor( Color.TRANSPARENT );
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recoverLockMode() {
|
||||
if ( checkMapView() ) {
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
Logger.d( TAG, "锁车" );
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW );
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
mIsCarLocked = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loseLockMode() {
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
Logger.d( TAG, "解锁锁车" );
|
||||
mockTouchEvent();
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
style.myLocationType( MyLocationStyle.LOCATION_TYPE_FOLLOW_NO_CENTER );
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
mIsCarLocked = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟点击事件,达到锁车->普通事件
|
||||
*/
|
||||
private void mockTouchEvent() {
|
||||
long downTime = SystemClock.uptimeMillis();
|
||||
long eventTime = downTime + 1;
|
||||
int metaState = 0;
|
||||
MotionEvent motionEvent = MotionEvent.obtain( downTime, eventTime, MotionEvent.ACTION_DOWN, 0, 0, metaState );
|
||||
mMapView.dispatchTouchEvent( motionEvent );
|
||||
MotionEvent upEvent = MotionEvent.obtain( downTime + 1, eventTime + 2, MotionEvent.ACTION_UP, 0, 0, metaState );
|
||||
mMapView.dispatchTouchEvent( upEvent );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockZoom( int var1 ) {
|
||||
if ( checkMapView() ) {
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
Logger.d( TAG, "Zoom锁定锁车比例尺 %s", var1 );
|
||||
// TODO: 2020/8/27 设置锁车比例尺
|
||||
// mMapView.setLockZoom( var1 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview( Rect bounds ) {
|
||||
if ( checkMapView() ) {
|
||||
if ( NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
loseLockMode();
|
||||
NaviClient.getInstance( getContext() ).displayOverview( bounds );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
return getMap().getScalePerPixel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getZoomLevel() {
|
||||
return getMap().getZoomLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviStarted() {
|
||||
if ( checkMapView() ) {
|
||||
showMyLocation( false );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviStopped() {
|
||||
if ( checkMapView() ) {
|
||||
showMyLocation( true );
|
||||
NaviClient.getInstance( getContext() ).startAimlessMode();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdat( NaviInfo naviInfo ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCalculateSuccess() {
|
||||
loseLockMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChange( CameraPosition cameraPosition ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChangeFinish( CameraPosition cameraPosition ) {
|
||||
if ( cameraPosition != null ) {
|
||||
Trace.beginSection( "timer.onCameraChangeFinish" );
|
||||
MogoMapListenerHandler.getInstance().onMapChanged( ObjectUtils.fromAMap( cameraPosition.target ),
|
||||
cameraPosition.zoom,
|
||||
cameraPosition.tilt,
|
||||
cameraPosition.bearing );
|
||||
Trace.endSection();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraNorthEastPosition() {
|
||||
try {
|
||||
return ObjectUtils.fromAMap( mMapView.getMap().getProjection().getVisibleRegion().latLngBounds.northeast );
|
||||
} catch ( Exception e ) {
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraSouthWestPosition() {
|
||||
try {
|
||||
return ObjectUtils.fromAMap( mMapView.getMap().getProjection().getVisibleRegion().latLngBounds.southwest );
|
||||
} catch ( Exception e ) {
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getWindowCenterLocation() {
|
||||
try {
|
||||
return ObjectUtils.fromAMap( mMapView.getMap().getCameraPosition().target );
|
||||
} catch ( Exception e ) {
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter( double mapCenterX, double mapCenterY ) {
|
||||
if ( checkMapView() ) {
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
Logger.d( TAG, "setPointToCenter(%s, %s)", mapCenterX, mapCenterY );
|
||||
mMapView.getMap().setPointToCenter( ( ( int ) ( mapCenterX * WindowUtils.getScreenWidth( getContext() ) ) ),
|
||||
( ( int ) ( mapCenterY * WindowUtils.getScreenHeight( getContext() ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getLocationPointInScreen( MogoLatLng latLng ) {
|
||||
if ( checkMapView() ) {
|
||||
try {
|
||||
return mMapView.getMap()
|
||||
.getProjection()
|
||||
.toScreenLocation( ObjectUtils.fromMogo2( latLng ) );
|
||||
} catch ( Exception e ) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getLocationMogoLatLngInScreen( Point point ) {
|
||||
if ( checkMapView() ) {
|
||||
try {
|
||||
return ObjectUtils.fromAMap(
|
||||
mMapView.getMap().getProjection().fromScreenLocation( point ) );
|
||||
} catch ( Exception e ) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startJumpAnimation( IMogoMarker marker, float high, Interpolator interpolator,
|
||||
long duration ) {
|
||||
if ( marker == null || high <= 0.0f || interpolator == null || duration < 0 ) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
final LatLng latLng = ObjectUtils.fromMogo2( marker.getPosition() );
|
||||
Point point = mMapView.getMap().getProjection().toScreenLocation( latLng );
|
||||
point.y -= WindowUtils.dip2px( getContext(), high );
|
||||
LatLng target = mMapView.getMap().getProjection().fromScreenLocation( point );
|
||||
//使用TranslateAnimation,填写一个需要移动的目标点
|
||||
Animation animation = new TranslateAnimation( target );
|
||||
animation.setInterpolator( interpolator );
|
||||
//整个移动所需要的时间
|
||||
animation.setDuration( duration );
|
||||
//设置动画
|
||||
if ( marker instanceof AMapMarkerWrapper ) {
|
||||
( ( AMapMarkerWrapper ) marker ).getMarker().setAnimation( animation );
|
||||
( ( AMapMarkerWrapper ) marker ).getMarker().startAnimation();
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRenderFps( int fps ) {
|
||||
if ( checkMapView() ) {
|
||||
if ( mMapView.getMap() != null ) {
|
||||
mMapView.getMap().setRenderFps( fps );
|
||||
Logger.d( TAG, "设置刷新帧率 fps = %s", fps );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showBounds( String tag, MogoLatLng carPosition, List< MogoLatLng > lonLats, Rect bound, boolean lockCarPosition ) {
|
||||
if ( !checkMapView() ) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if ( DebugConfig.isDebug() ) {
|
||||
Logger.d( TAG, Log.getStackTraceString( new Throwable() ) );
|
||||
}
|
||||
LatLngBounds latLngBounds = MogoMapUtils.getLatLngBounds( carPosition, lonLats, lockCarPosition );
|
||||
if ( !lockCarPosition ) {
|
||||
loseLockMode();
|
||||
}
|
||||
mMapView.getMap().moveCamera( CameraUpdateFactory.newLatLngBoundsRect( latLngBounds, bound.left, bound.right, bound.top, bound.bottom ) );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "%s error.", tag );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceRender() {
|
||||
if ( checkMapView() ) {
|
||||
mMapView.getMap().runOnDrawFrame();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateLineDistance( MogoLatLng p1, MogoLatLng p2 ) throws Exception {
|
||||
if ( p1 == null || p2 == null ) {
|
||||
throw new Exception( "计算距离的点不能为 null" );
|
||||
}
|
||||
return AMapUtils.calculateLineDistance( ObjectUtils.fromMogo2( p1 ), ObjectUtils.fromMogo2( p2 ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMyLocationChange( Location location ) {
|
||||
NaviClient.getInstance( getContext() ).syncCarLocation( location );
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumMapUI getCurrentUiMode() {
|
||||
return mCurrentUIMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMyLocation( Location location ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean isCarLocked() {
|
||||
return mIsCarLocked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCarCursorOption( CarCursorOption option ) {
|
||||
if ( mCarCursorOption != null && mCarCursorOption != DEFAULT_OPTION ) {
|
||||
mCarCursorOption.destroy();
|
||||
}
|
||||
if ( option != null ) {
|
||||
try {
|
||||
mCarCursorOption = option.clone();
|
||||
} catch ( Exception e ) {
|
||||
mCarCursorOption = DEFAULT_OPTION;
|
||||
}
|
||||
} else {
|
||||
mCarCursorOption = DEFAULT_OPTION;
|
||||
}
|
||||
if ( !checkMapView() ) {
|
||||
return;
|
||||
}
|
||||
if ( mMapView.getMap() == null ) {
|
||||
return;
|
||||
}
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
if ( mCarCursorOption.getCarCursorBmp() != null && !mCarCursorOption.getCarCursorBmp().isRecycled() ) {
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromBitmap( mCarCursorOption.getCarCursorBmp() ) );
|
||||
} else {
|
||||
if ( mCarCursorOption.getCarCursorRes() != 0 ) {
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromResource( mCarCursorOption.getCarCursorRes() ) );
|
||||
} else {
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromResource( DEFAULT_OPTION.getCarCursorRes() ) );
|
||||
}
|
||||
}
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapCameraPosition getMapCameraPosition() {
|
||||
if ( checkMapView() ) {
|
||||
CameraPosition cameraPosition = mMapView.getMap().getCameraPosition();
|
||||
return ObjectUtils.fromAMap( cameraPosition );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeBearing( float bearing ) {
|
||||
if ( checkMapView() ) {
|
||||
mMapView.getMap().moveCamera( CameraUpdateFactory.changeBearing( bearing ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,15 +37,15 @@ public class AMapWrapper implements IMogoMap {
|
||||
private static final String TAG = "AMapWrapper";
|
||||
|
||||
private static AMap sAMap;
|
||||
private final Context mContext;
|
||||
private IMogoMapUIController mUIcontroller;
|
||||
private AMap mAMap;
|
||||
private AMapNaviView mMapView;
|
||||
private IMogoUiSettings mUiSettings;
|
||||
|
||||
public AMapWrapper( AMap map, AMapNaviView mapView, IMogoMapUIController controller ) {
|
||||
public AMapWrapper( AMap map, Context context, IMogoMapUIController controller ) {
|
||||
this.mAMap = map;
|
||||
sAMap = map;
|
||||
this.mMapView = mapView;
|
||||
mContext = context;
|
||||
mUIcontroller = controller;
|
||||
// 设置实现自定义 info window
|
||||
mAMap.setInfoWindowAdapter( new AMapInfoWindowAdapter() );
|
||||
@@ -248,6 +248,6 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
|
||||
private Context getContext() {
|
||||
return mMapView.getContext();
|
||||
return mContext;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Automatically generated file. DO NOT MODIFY
|
||||
*/
|
||||
package com.zhidao.mogo.module.event.panel;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final boolean DEBUG = false;
|
||||
public static final String LIBRARY_PACKAGE_NAME = "com.zhidao.mogo.module.event.panel";
|
||||
/**
|
||||
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String APPLICATION_ID = "com.zhidao.mogo.module.event.panel";
|
||||
public static final String BUILD_TYPE = "release";
|
||||
public static final String FLAVOR = "";
|
||||
public static final int VERSION_CODE = 1;
|
||||
public static final String VERSION_NAME = "1.0.0-SNAPSHOT";
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.zhidao.mogo.module.event.panel.EventPanelModuleProvider;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Group$$event implements IRouteGroup {
|
||||
@Override
|
||||
public void loadInto(Map<String, RouteMeta> atlas) {
|
||||
atlas.put("/event/panel", RouteMeta.build(RouteType.PROVIDER, EventPanelModuleProvider.class, "/event/panel", "event", null, -1, -2147483648));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.enums.RouteType;
|
||||
import com.alibaba.android.arouter.facade.model.RouteMeta;
|
||||
import com.alibaba.android.arouter.facade.template.IProviderGroup;
|
||||
import com.zhidao.mogo.module.event.panel.EventPanelModuleProvider;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Providers$$mogomoduleeventpanelnoop implements IProviderGroup {
|
||||
@Override
|
||||
public void loadInto(Map<String, RouteMeta> providers) {
|
||||
providers.put("com.mogo.service.eventpanel.IEventPanelProvider", RouteMeta.build(RouteType.PROVIDER, EventPanelModuleProvider.class, "/event/panel", "event", null, -1, -2147483648));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.alibaba.android.arouter.routes;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IRouteGroup;
|
||||
import com.alibaba.android.arouter.facade.template.IRouteRoot;
|
||||
import java.lang.Class;
|
||||
import java.lang.Override;
|
||||
import java.lang.String;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* DO NOT EDIT THIS FILE!!! IT WAS GENERATED BY AROUTER. */
|
||||
public class ARouter$$Root$$mogomoduleeventpanelnoop implements IRouteRoot {
|
||||
@Override
|
||||
public void loadInto(Map<String, Class<? extends IRouteGroup>> routes) {
|
||||
routes.put("event", ARouter$$Group$$event.class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.module.event.panel"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0.0-SNAPSHOT" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="22" />
|
||||
/
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1 @@
|
||||
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0.0-SNAPSHOT","enabled":true,"outputFile":"mogo-module-event-panel-noop-release.aar","fullName":"release","baseName":"release"},"path":"AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.module.event.panel","split":""}}]
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/main/jniLibs"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/release/jniLibs"/></dataSet></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/main/shaders"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/release/shaders"/></dataSet></merger>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/main/assets"/><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/build/intermediates/shader_assets/release/compileReleaseShaders/out"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/release/assets"/></dataSet></merger>
|
||||
@@ -0,0 +1 @@
|
||||
#Tue Aug 25 16:46:31 CST 2020
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/main/res"/><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/build/generated/res/rs/release"/><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/build/generated/res/resValues/release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/main/res"/><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/build/generated/res/rs/release"/><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/build/generated/res/resValues/release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/release/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release" generated-set="release$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/release/res"/></dataSet><mergedItems/></merger>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.zhidao.mogo.module.event.panel"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0.0-SNAPSHOT" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="19"
|
||||
android:targetSdkVersion="22" />
|
||||
/
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,2 @@
|
||||
R_DEF: Internal format may change without notice
|
||||
local
|
||||
@@ -0,0 +1,14 @@
|
||||
1<?xml version="1.0" encoding="utf-8"?>
|
||||
2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
3 package="com.zhidao.mogo.module.event.panel"
|
||||
4 android:versionCode="1"
|
||||
5 android:versionName="1.0.0-SNAPSHOT" >
|
||||
6
|
||||
7 <uses-sdk
|
||||
8 android:minSdkVersion="19"
|
||||
8-->/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/main/AndroidManifest.xml
|
||||
9 android:targetSdkVersion="22" />
|
||||
9-->/Users/congtaowang/Public/AndroidStudioProjects/zhidao/yycp/MogoLauncher/modules/mogo-module-event-panel-noop/src/main/AndroidManifest.xml
|
||||
10 /
|
||||
11
|
||||
12</manifest>
|
||||
@@ -0,0 +1 @@
|
||||
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0.0-SNAPSHOT","enabled":true,"outputFile":"mogo-module-event-panel-noop-release.aar","fullName":"release","baseName":"release"},"path":"../../library_manifest/release/AndroidManifest.xml","properties":{"packageId":"com.zhidao.mogo.module.event.panel","split":""}}]
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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