dev
@@ -71,7 +71,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
// 设置是否开启自动黑夜模式切换,默认为false,不自动切换
|
||||
options.setAutoNaviViewNightMode( false );
|
||||
// 设置6秒后是否自动锁车
|
||||
options.setAutoLockCar( true );
|
||||
options.setAutoLockCar( false );
|
||||
// 设置路线上的摄像头气泡是否显示
|
||||
options.setCameraBubbleShow( true );
|
||||
// 设置路线相关的配置属性,如:路线的路况颜色,路线上是否显示摄像头气泡等。
|
||||
@@ -80,6 +80,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
options.setCarBitmap( BitmapFactory.decodeResource( getContext().getResources(), R.drawable.ic_amap_navi_cursor ) );
|
||||
// 设置指南针图标否在导航界面显示,默认显示。true,显示;false,隐藏。
|
||||
options.setCompassEnabled( false );
|
||||
// 黑夜模式
|
||||
options.setNaviNight( true );
|
||||
//设置路况光柱条是否显示(只适用于驾车导航,需要联网)。
|
||||
options.setTrafficBarEnabled( false );
|
||||
// 设置[实时交通图层开关按钮]是否显示(只适用于驾车导航,需要联网)。
|
||||
@@ -391,8 +393,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public void moveToCenter( MogoLatLng latLng ) {
|
||||
if ( latLng == null ) {
|
||||
Logger.e( TAG, "latlng = null" );
|
||||
if ( latLng == null || latLng.lat == 0.0d || latLng.lng == 0.0d ) {
|
||||
Logger.e( TAG, "latlng = null or is illegal" );
|
||||
return;
|
||||
}
|
||||
mMapView.getMap().animateCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) );
|
||||
|
||||
@@ -109,7 +109,7 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( NaviInfo naviInfo ) {
|
||||
MogoNaviListenerHandler.getInstance().onNaviInfoUpdate( ObjectUtils.fromAMap( naviInfo ) );
|
||||
MogoNaviListenerHandler.getInstance().onNaviInfoUpdate( ObjectUtils.fromAMap( mContext, naviInfo ) );
|
||||
mNaviOverlayHelper.handleNaviInfoUpdate( naviInfo );
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.mogo.map.impl.amap.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import com.amap.api.navi.enums.IconType;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-09-29
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class IconTypeUtils {
|
||||
|
||||
private static SparseArray< String > sIconName = new SparseArray<>();
|
||||
|
||||
static {
|
||||
sIconName.put( IconType.ARRIVED_DESTINATION, "到达目的地" );
|
||||
sIconName.put( IconType.ARRIVED_SERVICE_AREA, "到达服务区" );
|
||||
sIconName.put( IconType.ARRIVED_TOLLGATE, "到达收费站" );
|
||||
sIconName.put( IconType.ARRIVED_TUNNEL, "到达隧道" );
|
||||
sIconName.put( IconType.ARRIVED_WAYPOINT, "到达途经点" );
|
||||
sIconName.put( IconType.BRIDGE, "通过桥" );
|
||||
sIconName.put( IconType.BY_ELEVATOR, "电梯换层" );
|
||||
sIconName.put( IconType.BY_ESCALATOR, "扶梯换层" );
|
||||
sIconName.put( IconType.BY_STAIR, "楼梯换层" );
|
||||
sIconName.put( IconType.CABLEWAY, "通过索道" );
|
||||
sIconName.put( IconType.CHANNEL, "通过通道" );
|
||||
sIconName.put( IconType.CROSSWALK, "通过人行横道" );
|
||||
sIconName.put( IconType.CRUISE_ROUTE, "通过游船路线" );
|
||||
sIconName.put( IconType.DEFAULT, "自车" );
|
||||
sIconName.put( IconType.ENTER_BUILDING, "进入建筑物" );
|
||||
sIconName.put( IconType.ENTER_ROUNDABOUT, "进入环岛" );
|
||||
sIconName.put( IconType.ENTRY_LEFT_RING, "进入环岛" );
|
||||
sIconName.put( IconType.ENTRY_LEFT_RING_CONTINUE, "绕环岛直行" );
|
||||
sIconName.put( IconType.ENTRY_LEFT_RING_LEFT, "绕环岛左转" );
|
||||
sIconName.put( IconType.ENTRY_LEFT_RING_RIGHT, "绕环岛右转" );
|
||||
sIconName.put( IconType.ENTRY_LEFTRINGU_TURN, "绕环岛调头" );
|
||||
sIconName.put( IconType.ENTRY_RING_CONTINUE, "绕环岛直行" );
|
||||
sIconName.put( IconType.ENTRY_RING_LEFT, "绕环岛左转" );
|
||||
sIconName.put( IconType.ENTRY_RING_RIGHT, "绕环岛右转" );
|
||||
sIconName.put( IconType.ENTRY_RING_UTURN, "绕环岛调头" );
|
||||
sIconName.put( IconType.FERRY, "通过轮渡" );
|
||||
sIconName.put( IconType.LADDER, "通过阶梯" );
|
||||
sIconName.put( IconType.LEAVE_BUILDING, "离开建筑物" );
|
||||
sIconName.put( IconType.LEAVE_LEFT_RING, "驶出环岛" );
|
||||
sIconName.put( IconType.LEFT, "左转" );
|
||||
sIconName.put( IconType.LEFT_BACK, "左后" );
|
||||
sIconName.put( IconType.LEFT_FRONT, "左前方" );
|
||||
sIconName.put( IconType.LEFT_TURN_AROUND, "左转掉头" );
|
||||
sIconName.put( IconType.LIFT, "通过直梯" );
|
||||
sIconName.put( IconType.LOW_CROSS, "通过普通路口" );
|
||||
sIconName.put( IconType.LOW_TRAFFIC_CROSS, "红绿灯路口" );
|
||||
sIconName.put( IconType.NONE, "无定义" );
|
||||
sIconName.put( IconType.OUT_ROUNDABOUT, "驶出环岛" );
|
||||
sIconName.put( IconType.OVERPASS, "通过过街天桥" );
|
||||
sIconName.put( IconType.PARK, "通过公园" );
|
||||
sIconName.put( IconType.RIGHT, "右转" );
|
||||
sIconName.put( IconType.RIGHT_BACK, "右后方" );
|
||||
sIconName.put( IconType.RIGHT_FRONT, "右前方" );
|
||||
sIconName.put( IconType.SIGHTSEEING_BUSLINE, "通过观光车路线" );
|
||||
sIconName.put( IconType.SKY_CHANNEL, "通过空中通道" );
|
||||
sIconName.put( IconType.SLIDEWAY, "通过滑道" );
|
||||
sIconName.put( IconType.SLOPE, "通过斜坡" );
|
||||
sIconName.put( IconType.SPECIAL_CONTINUE, "顺行" );
|
||||
sIconName.put( IconType.SQUARE, "通过广场" );
|
||||
sIconName.put( IconType.STAIRCASE, "通过扶梯" );
|
||||
sIconName.put( IconType.STRAIGHT, "直行" );
|
||||
sIconName.put( IconType.SUBWAY, "通过地铁通道" );
|
||||
sIconName.put( IconType.U_TURN_RIGHT, "右转掉头" );
|
||||
sIconName.put( IconType.UNDERPASS, "通过地下通道" );
|
||||
sIconName.put( IconType.WALK_ROAD, "通过行人道路" );
|
||||
}
|
||||
|
||||
private static int lastIconType = 0;
|
||||
private static int lastIconResId = 0;
|
||||
|
||||
public static String getNameByIconType( int iconType ) {
|
||||
return sIconName.get( iconType );
|
||||
}
|
||||
|
||||
public static int getResIdByIconType( Context context, int iconType ) {
|
||||
try {
|
||||
if ( iconType == lastIconType ) {
|
||||
return lastIconResId;
|
||||
}
|
||||
int target = context.getResources().getIdentifier( "ic_" + iconType, "drawable", context.getPackageName() );
|
||||
lastIconType = iconType;
|
||||
lastIconResId = target;
|
||||
return target;
|
||||
} catch ( Exception e ) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.map.impl.amap.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.view.View;
|
||||
|
||||
@@ -622,7 +623,7 @@ public class ObjectUtils {
|
||||
return mogoPoiResult;
|
||||
}
|
||||
|
||||
public static MogoNaviInfo fromAMap( NaviInfo naviInfo ) {
|
||||
public static MogoNaviInfo fromAMap( Context context, NaviInfo naviInfo ) {
|
||||
if ( naviInfo == null ) {
|
||||
return null;
|
||||
}
|
||||
@@ -631,7 +632,7 @@ public class ObjectUtils {
|
||||
mogoNaviInfo.setCurrentSpeed( naviInfo.getCurrentSpeed() );
|
||||
mogoNaviInfo.setCurStepRetainDistance( naviInfo.getCurStepRetainDistance() );
|
||||
mogoNaviInfo.setCurStepRetainTime( naviInfo.getCurStepRetainTime() );
|
||||
mogoNaviInfo.setIconType( naviInfo.getIconType() );
|
||||
mogoNaviInfo.setIconResId( IconTypeUtils.getResIdByIconType( context, naviInfo.getIconType() ) );
|
||||
mogoNaviInfo.setNextRoadName( naviInfo.getNextRoadName() );
|
||||
mogoNaviInfo.setPathRetainDistance( naviInfo.getPathRetainDistance() );
|
||||
mogoNaviInfo.setPathRetainTime( naviInfo.getPathRetainTime() );
|
||||
|
||||
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_1.png
Executable file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_10.png
Executable file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_11.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_12.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_13.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_14.png
Executable file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_15.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_16.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_17.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_18.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_19.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_2.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_20.png
Executable file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_21.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_22.png
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_23.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_24.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_25.png
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_26.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_27.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_28.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_3.png
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_4.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_5.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_50.png
Executable file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_51.png
Executable file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_52.png
Executable file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_53.png
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_54.png
Executable file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_55.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_56.png
Executable file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_57.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_58.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_59.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_6.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_60.png
Executable file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_61.png
Executable file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_62.png
Executable file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_63.png
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_64.png
Executable file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_65.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_66.png
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_67.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_68.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_69.png
Executable file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_7.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_8.png
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_9.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_10.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_11.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_12.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_13.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_14.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_15.png
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_16.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_17.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_20.png
Executable file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_21.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_22.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_23.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_24.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_25.png
Executable file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_26.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_27.png
Executable file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_28.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_30.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_31.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_32.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_33.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_34.png
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_35.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_36.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_37.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_38.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_39.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_40.png
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_41.png
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_42.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_43.png
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_44.png
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_68.png
Executable file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_84.png
Executable file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/tc_85.png
Executable file
|
After Width: | Height: | Size: 1.5 KiB |