expo-gaode-map-navigation 1.1.5-next.0 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -58,6 +58,7 @@ class ExpoGaodeMapNaviView(context: Context, appContext: AppContext) : ExpoView(
|
|
|
58
58
|
internal var isAfterRouteAutoGray: Boolean = false
|
|
59
59
|
internal var isVectorLineShow: Boolean = true
|
|
60
60
|
internal var isNaviTravelView : Boolean = false
|
|
61
|
+
internal var isCompassEnabled: Boolean = true
|
|
61
62
|
private val naviView: AMapNaviView = AMapNaviView(context)
|
|
62
63
|
private var aMapNavi: AMapNavi? = null
|
|
63
64
|
private var startCoordinate: NaviLatLng? = null
|
|
@@ -329,7 +330,7 @@ class ExpoGaodeMapNaviView(context: Context, appContext: AppContext) : ExpoView(
|
|
|
329
330
|
// 设置为 true 将显示导航信息面板(包括距离、时间等)
|
|
330
331
|
options.isLayoutVisible = showUIElements
|
|
331
332
|
options.isSettingMenuEnabled = true // 显示设置菜单按钮
|
|
332
|
-
options.isCompassEnabled =
|
|
333
|
+
options.isCompassEnabled = isCompassEnabled // 显示指南针
|
|
333
334
|
options.isTrafficBarEnabled = androidTrafficBarEnabled // 显示路况条
|
|
334
335
|
options.isRouteListButtonShow = isRouteListButtonShow // 显示路线全览按钮
|
|
335
336
|
|
|
@@ -843,7 +844,15 @@ class ExpoGaodeMapNaviView(context: Context, appContext: AppContext) : ExpoView(
|
|
|
843
844
|
options.isRealCrossDisplayShow = enabled
|
|
844
845
|
naviView.viewOptions = options
|
|
845
846
|
}
|
|
846
|
-
|
|
847
|
+
|
|
848
|
+
fun applyShowCompassEnabled(enabled: Boolean){
|
|
849
|
+
isCompassEnabled = enabled
|
|
850
|
+
val options = naviView.viewOptions
|
|
851
|
+
options.isCompassEnabled = enabled
|
|
852
|
+
naviView.viewOptions = options
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
|
|
847
856
|
fun applyNaviMode(mode: Int) {
|
|
848
857
|
// 0: 车头朝上 1: 正北朝上
|
|
849
858
|
naviView.naviMode = mode
|
|
@@ -884,7 +893,8 @@ class ExpoGaodeMapNaviView(context: Context, appContext: AppContext) : ExpoView(
|
|
|
884
893
|
Log.e("ExpoGaodeMapNaviView", "Failed to set car overlay visibility", e)
|
|
885
894
|
}
|
|
886
895
|
}
|
|
887
|
-
|
|
896
|
+
|
|
897
|
+
|
|
888
898
|
/**
|
|
889
899
|
* 设置是否显示交通信号灯
|
|
890
900
|
* @param visible true-显示 false-隐藏
|
package/android/src/main/java/expo/modules/gaodemap/navigation/ExpoGaodeMapNaviViewModule.kt
CHANGED
|
@@ -75,6 +75,10 @@ class ExpoGaodeMapNaviViewModule : Module() {
|
|
|
75
75
|
Prop<Boolean>("showTrafficLights") { view, visible ->
|
|
76
76
|
view.applyTrafficLightsVisible(visible)
|
|
77
77
|
}
|
|
78
|
+
|
|
79
|
+
Prop<Boolean>("showCompassEnabled") {view, enabled ->
|
|
80
|
+
view.applyShowCompassEnabled(enabled)
|
|
81
|
+
}
|
|
78
82
|
|
|
79
83
|
Prop<Map<String, Boolean>?>("routeMarkerVisible") { view, config ->
|
|
80
84
|
config?.let {
|
package/package.json
CHANGED