Commit 1fced44e authored by p x's avatar p x
Browse files

不让用户传入mapreadyView

parent aeb35fb4
......@@ -28,6 +28,10 @@ import com.sd.api.maps.mine.MineNaiParams
import com.sd.api.maps.mine.MineRoutePlans
import com.sd.api.intfaces.OnComCan
import com.sd.api.intfaces.OnNaviPresenterListener
import com.sd.api.location.MSLocCb
import com.sd.api.location.MSLocation
import com.sd.api.location.OnMsGpsLoc
import com.sd.api.maps.MSNavi
import com.sd.api.maps.MSRoutePlans
import com.sd.api.ui.MapMultiView.OnMapReadyLis
import com.sd.api.ui.dialog.ExitNaiDialog
......@@ -44,9 +48,6 @@ class MineNaiDirActivity : AppCompatActivity(), OnNaviPresenterListener {
private var mineNaiParams: MineNaiParams? = null
//获取接口功能实例
// private var mapCoreApi = MapCoreApi.mapCoreApi
//四维导航地图工具
private lateinit var mUtils: Utils
......@@ -66,11 +67,22 @@ class MineNaiDirActivity : AppCompatActivity(), OnNaviPresenterListener {
mUtils.init(this)
mineNaiParams = intent.getParcelableExtra<MineNaiParams>("mineNaiParams")
MineNai.onNaviPresenterListener = this
//开启定位
MSLocation.startLoc(object : OnMsGpsLoc {
override fun onMsGpsLoc(mSLocBean: MSLocCb) {
println("---------mSLocBean = ${mSLocBean.lng}")
}
})
// MineNai.onNaviPresenterListener = this
MSNavi.init()
MSNavi.addNaviListener(this)
binding.mapMultiView.addMapRenderCallback(object : OnMapReadyLis {
override fun onMapReady(mapReadyView: MapReadyView) {
this@MineNaiDirActivity.mapReadView = mapReadyView
//切换为2D平面图
// mapReadyView.mMineMap?.elevation=0f
//算路成功以后启动导航
......@@ -91,7 +103,7 @@ class MineNaiDirActivity : AppCompatActivity(), OnNaviPresenterListener {
//开始路径规划
MSRoutePlans.drivingPathPlanning(
startPoint, startName, endPoint, endName, ways, mapReadView, object : OnDriveRoute {
startPoint, startName, endPoint, endName, ways, object : OnDriveRoute {
override fun onDriverRoute(driverRouteBean: DriverRouteBean) {
var routeBase = driverRouteBean.routeBase
MineNai.startNaviFormRouteBase(routeBase, startPoint, mapReadView)
......@@ -143,14 +155,14 @@ class MineNaiDirActivity : AppCompatActivity(), OnNaviPresenterListener {
showNavingCarPosition(data.carPos, carHeading)
mineMap?.setHeading(mapHeading)
mineMap?.setElevation(50.0f)
mineMap?.setFovy(35f)
mineMap?.setViewShiftXY(0f, 0.55f)
// mineMap?.setElevation(50.0f)
// mineMap?.setFovy(35f)
// mineMap?.setViewShiftXY(0f, 0.55f)
mineMap?.setNdsPointToCenter(data.carPos.x, data.carPos.y)
val zoomLevel = mineMap!!.getAutomaticZoomLevelForMineMap(0.2f)
if (zoomLevel != -1f) {
mineMap!!.setZoomLevel(zoomLevel)
}
// val zoomLevel = mineMap!!.getAutomaticZoomLevelForMineMap(0.2f)
// if (zoomLevel != -1f) {
// mineMap!!.setZoomLevel(zoomLevel)
// }
}
......
......@@ -12,8 +12,6 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import androidx.core.content.ContextCompat;
import com.minedata.minenavi.mapdal.NativeEnv;
import com.minedata.minenavi.navi.LaneDetector;
import com.sd.api.R;
......@@ -190,14 +188,15 @@ public class MyLaneView extends LinearLayout implements LaneDetector.OnLaneDetec
/**
* 分割线
**/
* @param height 箭头的高度
*/
private ImageView createSepView(int height) {
ImageView view = new ImageView(context);
ColorDrawable colorDrawable = new ColorDrawable(Color.parseColor("#99FFFFFF"));
view.setBackground(colorDrawable);
LayoutParams params = new LayoutParams(-2, -1);
params.width = NativeEnv.dp2px(1.0F);
params.height = height - NativeEnv.dp2px(2.0F);
params.height = height - NativeEnv.dp2px(8.0F);
params.setMargins(this.mIconMargin, 0, this.mIconMargin, 0);
view.setLayoutParams(params);
return view;
......
......@@ -416,20 +416,23 @@ public class TmcBar extends RelativeLayout {
mDrawContentPaint.setColor(Color.parseColor("#43CA63"));//绿色
break;
case TmcSections.State.medium:
mDrawContentPaint.setColor(Color.parseColor("#F9B000"));//黄色
mDrawContentPaint.setColor(Color.parseColor("#4ECDC4"));
break;
case TmcSections.State.heavy:
mDrawContentPaint.setColor(Color.parseColor("#F45956"));//红
mDrawContentPaint.setColor(Color.parseColor("#F9B000"));
break;
case TmcSections.State.blocked:
mDrawContentPaint.setColor(Color.parseColor("#701200"));//
mDrawContentPaint.setColor(Color.parseColor("#F45956"));//
break;
case TmcSections.State.unknown:
mDrawContentPaint.setColor(Color.parseColor("#5AC8FA"));
break;
case TmcSections.State.none:
mDrawContentPaint.setColor(Color.parseColor("#3385FE"));//蓝色
mDrawContentPaint.setColor(Color.parseColor("#007AFF"));
break;
default:
mDrawContentPaint.setColor(Color.parseColor("#C3C0C0"));
// mDrawContentPaint.setColor(Color.parseColor("#8E8E93"));
mDrawContentPaint.setColor(Color.parseColor("#C9C9C9"));
break;
}
return mDrawContentPaint;
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 0 没有定位 -->
<item android:state_pressed="true" android:drawable="@drawable/myloc_blue"/>
<!-- 1 锁定 -->
<item android:state_pressed="false" android:drawable="@drawable/myloc_grey" />
</selector>
<!--<level-list xmlns:android="http://schemas.android.com/apk/res/android">-->
<!-- &lt;!&ndash; 0 没有定位 &ndash;&gt;-->
<!-- <item android:maxLevel="0" android:drawable="@drawable/myloc_blue"/>-->
<!-- &lt;!&ndash; 1 锁定 &ndash;&gt;-->
<!-- <item android:maxLevel="1" android:drawable="@drawable/myloc_grey" />-->
<!--</level-list>-->
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="50dp"/>
<solid android:color="@color/white"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="10dp"/>
<solid android:color="#E6FFFFFF"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.amap.api.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mMapView"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.amap.api.maps.MapView
android:id="@+id/mMapView"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<!--定位按钮-->
<ImageView
android:id="@+id/ivLocation"
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@drawable/compass_bg"
android:visibility="gone"
android:scaleType="centerInside"
android:src="@drawable/location_start" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<com.minedata.minenavi.map.MapView xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.ForeMapFragment" />
tools:context=".fragments.ForeMapFragment">
<com.minedata.minenavi.map.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- <LinearLayout-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:orientation="vertical">-->
<!-- </LinearLayout>-->
<!--定位按钮-->
<ImageView
android:id="@+id/ivLocation"
android:layout_width="@dimen/dp_45"
android:layout_height="@dimen/dp_45"
android:background="@drawable/compass_bg"
android:scaleType="centerInside"
android:layout_marginTop="@dimen/dp_10"
android:layout_alignParentRight="true"
android:layout_marginRight="8dp"
android:visibility="gone"
android:src="@drawable/location_start" />
<!-- 指南针-->
<com.minedata.minenavi.map.CompassView
android:id="@+id/compassView"
android:layout_width="@dimen/map_right_bot_widget"
android:layout_height="@dimen/map_right_bot_widget"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:background="@drawable/compass_bg"
android:scaleType="centerInside"
android:src="@drawable/compass"
android:visibility="gone" />
<!-- 比例尺-->
<com.minedata.minenavi.map.ScaleView
android:id="@+id/scaleView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:visibility="gone"/>
</RelativeLayout>
<!-- smallView="true"-->
......
......@@ -20,9 +20,7 @@
android:id="@+id/my_navi_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/rect_white_10"
android:orientation="vertical">
android:background="@drawable/nai_rect_10">
<RelativeLayout
android:id="@+id/RL_1"
......@@ -42,12 +40,13 @@
android:id="@+id/turnIconView"
android:layout_width="@dimen/dp_55"
android:layout_height="@dimen/dp_55"
android:scaleType="centerInside" />
android:scaleType="centerInside"
android:paddingBottom="4dp"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="@dimen/dp_55"
android:layout_alignTop="@+id/turnIconView"
android:layout_marginLeft="8dp"
android:layout_toRightOf="@+id/turnIconView">
......@@ -56,11 +55,11 @@
android:id="@+id/tv_turnDistance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-3dp"
android:layout_marginTop="-5dp"
android:textColor="@color/text_black"
android:textStyle="bold"
tools:text="2.5公里"
tools:textSize="22sp" />
tools:textSize="28sp" />
<TextView
android:id="@+id/tv_turnAction"
......@@ -79,9 +78,8 @@
android:id="@+id/tv_turnRoadName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_turnDistance"
android:layout_alignLeft="@+id/tv_turnDistance"
android:layout_marginTop="2dp"
android:layout_alignParentBottom="true"
android:textColor="#80000000"
tools:text="北清路" />
......@@ -111,7 +109,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="•"
android:textColor="@color/text_black" />
android:textColor="@color/text_black"
android:textSize="11sp" />
<!-- 剩余时间-->
<TextView
......@@ -125,8 +124,8 @@
<ImageView
android:id="@+id/iv_bottomTrafficLight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="11dp"
android:layout_height="11dp"
android:layout_marginLeft="3dp"
android:src="@drawable/traffic" />
......@@ -158,7 +157,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dp_15"
android:layout_below="@+id/RL_1"
android:layout_marginTop="2dp">
android:layout_marginTop="5dp">
<com.sd.api.ui.widget.TmcBar
android:id="@+id/tmcBar_view"
......@@ -166,7 +165,7 @@
android:layout_height="@dimen/dp_5"
android:layout_centerVertical="true"
android:layout_marginTop="4dp"
android:background="#00000000"
android:background="#C9C9C9"
tools:ignore="RtlSymmetry" />
<View
......@@ -209,6 +208,7 @@
</RelativeLayout>
<!-- <ImageView-->
<!-- android:layout_width="@dimen/dp_15"-->
<!-- android:layout_height="@dimen/dp_15"-->
......
......@@ -439,6 +439,6 @@
<dimen name="nz_px_400">192.00dp</dimen>
<dimen name="map_left_top_widget">260dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="map_right_bot_widget">40dp</dimen>
</resources>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment