[3.4.0-map-sdk] update ,wait to test
This commit is contained in:
@@ -12,7 +12,6 @@ import kotlinx.android.synthetic.jinlvvan.p_bus_view_blue_tooth.view.*
|
||||
/**
|
||||
* 魔戒蓝牙控件
|
||||
* 放置于StatusBar右侧位置
|
||||
* todo arrow
|
||||
*/
|
||||
class BusPBlueToothView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
android:id="@+id/mapBizView"
|
||||
android:layout_width="1810dp"
|
||||
android:layout_height="match_parent"
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:isShadowEnable="true"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/xiaoba"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.och.bus.fragment;
|
||||
import static com.mogo.och.bus.constant.BusConst.TIMER_START_AUTOPILOT_INTERVAL;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -319,7 +320,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
slidePanelView.setText(text);
|
||||
slidePanelView.setVisibility(View.VISIBLE);
|
||||
});
|
||||
setArrivedClikable(false);
|
||||
setArrivedClickable(false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -327,7 +328,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
*
|
||||
* @param isClickable
|
||||
*/
|
||||
public void setArrivedClikable(boolean isClickable) {
|
||||
public void setArrivedClickable(boolean isClickable) {
|
||||
getActivity().runOnUiThread(() -> {
|
||||
tvArrived.setEnabled(isClickable);
|
||||
if (isClickable) {
|
||||
@@ -410,12 +411,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
ctvAutopilotStatus.setClickable(false);
|
||||
// ctvAutopilotStatus.setSelected(false);
|
||||
}
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setAutopilotBtnStatus(autopilotStatus);
|
||||
}
|
||||
}, 1000);
|
||||
UiThreadHandler.postDelayed(() -> setAutopilotBtnStatus(autopilotStatus), 1000);
|
||||
}
|
||||
|
||||
private void changeAutopilotBtnView(int autopilotStatus, boolean isAnimateRunning) {
|
||||
@@ -503,13 +499,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
private void startingAutoApilotCountDown() {
|
||||
//10s 若自动驾驶没有开启,则结束动画
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() { //未启动成功做处理
|
||||
if (isAnimateRunning) {// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
stopAutopilotAnimation();
|
||||
updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState());
|
||||
}
|
||||
UiThreadHandler.postDelayed(() -> { //未启动成功做处理
|
||||
if (isAnimateRunning) {// 只判断动画是否在进行,根据自动驾驶当前状态去设置自动驾驶状态
|
||||
stopAutopilotAnimation();
|
||||
updateAutopilotStatus(CallerAutoPilotStatusListenerManager.INSTANCE.getState());
|
||||
}
|
||||
}, TIMER_START_AUTOPILOT_INTERVAL);
|
||||
|
||||
@@ -529,8 +522,6 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
|
||||
/**
|
||||
* 迈速表实时更新
|
||||
*
|
||||
* @param newSpeed
|
||||
*/
|
||||
public void updateSpeedView(float newSpeed) {
|
||||
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
||||
@@ -580,6 +571,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
private TextView trajMd5DPQPTV;
|
||||
private TextView stopMd5DPQPTV;
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void showHideTestBar() {
|
||||
if (busTestBar == null) {
|
||||
busTestBar = findViewById(R.id.module_mogo_och_bus_test_bar);
|
||||
@@ -603,6 +595,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
public void updateBusTestBarInfo() {
|
||||
if (busTestBar != null && busTestBar.getVisibility() == View.VISIBLE) {
|
||||
BusRoutesResult routesResult = OrderModel.getInstance().getBusRoutesResult();
|
||||
@@ -613,7 +606,5 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
|
||||
stopMd5DPQPTV.setText("SMd5DPQP:" + (routesResult == null ? "" : routesResult.txtFileMd5DPQP));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* END
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
|
||||
}
|
||||
|
||||
public void updateLineEmptyUI() {
|
||||
setArrivedClikable(false);
|
||||
setArrivedClickable(false);
|
||||
showOrHideSwitchLineBtn(true);
|
||||
hideStationsPanel();
|
||||
hideSlidePanel();
|
||||
|
||||
@@ -143,7 +143,7 @@ public class BusPresenter extends Presenter<BusFragment>
|
||||
public void hideSlidePanel() {
|
||||
if (mView != null) {
|
||||
mView.hideSlidePanel();
|
||||
mView.setArrivedClikable(true);
|
||||
mView.setArrivedClickable(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/xiaoba"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
@@ -312,6 +312,6 @@ class MainFragment :
|
||||
}
|
||||
|
||||
companion object {
|
||||
public const val TAG = "BusPassengerRouteFragment"
|
||||
const val TAG = "BusPassengerRouteFragment"
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@
|
||||
android:layout_width="0dp"
|
||||
app:layout_constraintWidth_percent="0.662"
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m1"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import kotlinx.android.synthetic.jinlvvan.p_bus_view_blue_tooth.view.*
|
||||
/**
|
||||
* 魔戒蓝牙控件
|
||||
* 放置于StatusBar右侧位置
|
||||
* todo arrow
|
||||
*/
|
||||
class BusPBlueToothView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
android:layout_width="1810dp"
|
||||
android:layout_height="match_parent"
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m2"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
@@ -12,7 +12,6 @@ import kotlinx.android.synthetic.m2.p_m2_view_blue_tooth.view.*
|
||||
/**
|
||||
* 魔戒蓝牙控件
|
||||
* 放置于StatusBar右侧位置
|
||||
* todo arrow
|
||||
*/
|
||||
class M2BlueToothView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:carPosition="-0.5"
|
||||
app:default_perspective="MAP_STYLE_VR_ERHAI_B2"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.data.bean.BusRoutesResult;
|
||||
@@ -51,7 +50,6 @@ import com.mogo.och.common.module.utils.SoundPoolHelper;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import bag_manager.BagManagerOuterClass;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -17,9 +17,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.temp.EventLogout;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
@@ -31,7 +29,6 @@ import com.mogo.map.MapDataWrapper;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.och.bus.R;
|
||||
import com.mogo.och.data.bean.BusStationBean;
|
||||
import com.mogo.och.bus.constant.BusConst;
|
||||
@@ -55,8 +52,6 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils;
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/m2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:styleMode="MAP_STYLE_DAY_VR"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/chuzuche"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
@@ -89,9 +89,9 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
|
||||
protected SmallMapView smallMapView;
|
||||
|
||||
private Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
private final Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
|
||||
private Integer[] startAutopilotDrawableIds = new Integer[]{
|
||||
private final Integer[] startAutopilotDrawableIds = new Integer[]{
|
||||
R.drawable.anim_flow_00000, R.drawable.anim_flow_00001, R.drawable.anim_flow_00002,
|
||||
R.drawable.anim_flow_00003, R.drawable.anim_flow_00004, R.drawable.anim_flow_00005,
|
||||
R.drawable.anim_flow_00006, R.drawable.anim_flow_00007, R.drawable.anim_flow_00008,
|
||||
@@ -114,7 +114,7 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
R.drawable.anim_flow_00057, R.drawable.anim_flow_00058, R.drawable.anim_flow_00059
|
||||
};
|
||||
|
||||
private Integer[] startManCODrawableIds = new Integer[]{
|
||||
private final Integer[] startManCODrawableIds = new Integer[]{
|
||||
R.drawable.anim_flow_man_co_00000, R.drawable.anim_flow_man_co_00001,
|
||||
R.drawable.anim_flow_man_co_00002, R.drawable.anim_flow_man_co_00003,
|
||||
R.drawable.anim_flow_man_co_00004, R.drawable.anim_flow_man_co_00005,
|
||||
@@ -583,11 +583,6 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
|
||||
mSpeedView.setText(String.valueOf(speed));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapVisualAngleChanged(VisualAngleMode visualAngleMode) {
|
||||
//todo ui 切换
|
||||
}
|
||||
|
||||
protected void showAmapNaviToStationFragment(boolean isShow) {
|
||||
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
|
||||
@@ -18,7 +18,6 @@ import androidx.annotation.RequiresApi;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.amap.api.navi.model.NaviLatLng;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/chuzuche"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.mogo.och.sweepercloud.fragment;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_SWEEPER;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -16,7 +14,6 @@ import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.elegant.network.utils.GsonUtil;
|
||||
import com.google.protobuf.TextFormat;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
@@ -28,23 +25,19 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
import com.mogo.eagle.core.function.view.MapBizView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
|
||||
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
|
||||
import com.mogo.och.common.module.utils.PinYinUtil;
|
||||
import com.mogo.och.sweepercloud.R;
|
||||
import com.mogo.och.sweepercloud.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import com.mogo.och.sweepercloud.callback.ISweeperTaskDataToFragmentCallback;
|
||||
@@ -132,55 +125,52 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
//设置左下角四个按钮监听事件
|
||||
setBottomBtnListener();
|
||||
// 模拟 下发启动自驾命令
|
||||
findViewById(R.id.btnStartAutopilot).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
|
||||
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() + ", 请稍候重试");
|
||||
return;
|
||||
}
|
||||
new AutopilotModeConfigManager(new AutopilotModeConfigManager.OnReadAutopilotModeConfigListener() {
|
||||
@Override
|
||||
public void onReadFailed(String err) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
ToastUtils.showLong("读取失败=" + err);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onParseFailed(String err) {
|
||||
ToastUtils.showLong("解析失败=" + err);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onParse(MessagePad.SetAutopilotModeReq bean) {
|
||||
ToastUtils.showLong("下发命令\n" + TextFormat.printer().escapingNonAscii(false).printToString(bean));
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
MessagePad.RouteInfo routeInfo = bean.getRouteInfo();
|
||||
if (routeInfo.getRouteID() > 0) {
|
||||
parameters.routeID = routeInfo.getRouteID();
|
||||
}
|
||||
parameters.routeName = routeInfo.getRouteName();
|
||||
parameters.startName = routeInfo.getStartName();//拼音
|
||||
parameters.endName = routeInfo.getEndName();//拼音
|
||||
parameters.startLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat(routeInfo.getStartLocation().getLatitude(), routeInfo.getStartLocation().getLongitude());
|
||||
parameters.endLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat(routeInfo.getEndLocation().getLatitude(), routeInfo.getEndLocation().getLongitude());
|
||||
parameters.vehicleType = 10;
|
||||
MessagePad.Line line = routeInfo.getLine();
|
||||
parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
|
||||
line.getLineId(),
|
||||
line.getTrajUrl(), line.getTrajMd5(),
|
||||
line.getStopUrl(), line.getStopMd5(),
|
||||
line.getTimestamp(), line.getVehicleModel(),
|
||||
line.getTrajUrlDpqp(), line.getTrajMd5Dpqp(),
|
||||
line.getStopUrlDpqp(), line.getStopMd5Dpqp(),
|
||||
line.getTimestampDpqp());
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
}
|
||||
}).read();
|
||||
findViewById(R.id.btnStartAutopilot).setOnClickListener(v -> {
|
||||
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
|
||||
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() + ", 请稍候重试");
|
||||
return;
|
||||
}
|
||||
new AutopilotModeConfigManager(new AutopilotModeConfigManager.OnReadAutopilotModeConfigListener() {
|
||||
@Override
|
||||
public void onReadFailed(String err) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
ToastUtils.showLong("读取失败=" + err);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onParseFailed(String err) {
|
||||
ToastUtils.showLong("解析失败=" + err);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onParse(MessagePad.SetAutopilotModeReq bean) {
|
||||
ToastUtils.showLong("下发命令\n" + TextFormat.printer().escapingNonAscii(false).printToString(bean));
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
MessagePad.RouteInfo routeInfo = bean.getRouteInfo();
|
||||
if (routeInfo.getRouteID() > 0) {
|
||||
parameters.routeID = routeInfo.getRouteID();
|
||||
}
|
||||
parameters.routeName = routeInfo.getRouteName();
|
||||
parameters.startName = routeInfo.getStartName();//拼音
|
||||
parameters.endName = routeInfo.getEndName();//拼音
|
||||
parameters.startLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat(routeInfo.getStartLocation().getLatitude(), routeInfo.getStartLocation().getLongitude());
|
||||
parameters.endLatLon = new AutopilotControlParameters
|
||||
.AutoPilotLonLat(routeInfo.getEndLocation().getLatitude(), routeInfo.getEndLocation().getLongitude());
|
||||
parameters.vehicleType = 10;
|
||||
MessagePad.Line line = routeInfo.getLine();
|
||||
parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
|
||||
line.getLineId(),
|
||||
line.getTrajUrl(), line.getTrajMd5(),
|
||||
line.getStopUrl(), line.getStopMd5(),
|
||||
line.getTimestamp(), line.getVehicleModel(),
|
||||
line.getTrajUrlDpqp(), line.getTrajMd5Dpqp(),
|
||||
line.getStopUrlDpqp(), line.getStopMd5Dpqp(),
|
||||
line.getTimestampDpqp());
|
||||
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
|
||||
}
|
||||
}).read();
|
||||
});
|
||||
// 模拟 查询当前任务
|
||||
findViewById(R.id.btnQueryCurrentTask).setOnClickListener(view ->
|
||||
@@ -213,12 +203,9 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
findViewById(R.id.btnSendTaskStatus).setOnClickListener(view ->
|
||||
SweeperCloudTaskUtils.mockSendCloudBigTaskStatus()
|
||||
);
|
||||
mTrafficDataView.getSpeedImage().setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
debugTestBar();
|
||||
return false;
|
||||
}
|
||||
mTrafficDataView.getSpeedImage().setOnLongClickListener(v -> {
|
||||
debugTestBar();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -236,8 +223,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置任务进度
|
||||
*
|
||||
* @param progress
|
||||
*/
|
||||
protected void setTaskProgress(String progress) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
@@ -323,9 +308,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
private void initListener() {
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
|
||||
mMapWeltView.getSwitchToBig().setOnClickListener((v) -> {
|
||||
showOrHideOverMapViewFragment(true);
|
||||
});
|
||||
mMapWeltView.getSwitchToBig().setOnClickListener((v) -> showOrHideOverMapViewFragment(true));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -338,8 +321,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 迈速表实时更新
|
||||
*
|
||||
* @param newSpeed
|
||||
*/
|
||||
public void updateSpeedView(float newSpeed) {
|
||||
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
||||
@@ -350,8 +331,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 车辆基本信息View
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public SweeperTrafficDataView getTrafficDataView() {
|
||||
return mTrafficDataView;
|
||||
@@ -412,10 +391,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
}
|
||||
}
|
||||
});
|
||||
mSettingBtn.setOnClickListener(v -> {
|
||||
// TODO: 2021/12/9
|
||||
CallerHmiManager.INSTANCE.showToolsView();
|
||||
});
|
||||
mSettingBtn.setOnClickListener(v -> CallerHmiManager.INSTANCE.showToolsView());
|
||||
if (mCardBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initBadCase(mCardBtn);
|
||||
}
|
||||
@@ -426,8 +402,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置作业任务全览图隐藏或者显示
|
||||
*
|
||||
* @param isShow
|
||||
*/
|
||||
public void showOrHideOverMapViewFragment(boolean isShow) {
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
@@ -473,20 +447,15 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置贴边数据到地图
|
||||
*
|
||||
* @param weltDataBeans
|
||||
*/
|
||||
public void setWeltDataToMap(ArrayList<WeltDataBean> weltDataBeans, Boolean isWeltData, String distance) {
|
||||
mWeltDataBeanList = weltDataBeans;
|
||||
ThreadUtils.getSinglePool().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mMapWeltView != null) {
|
||||
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
|
||||
}
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setWeltData(weltDataBeans, distance);
|
||||
}
|
||||
ThreadUtils.getSinglePool().execute(() -> {
|
||||
if (mMapWeltView != null) {
|
||||
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
|
||||
}
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setWeltData(weltDataBeans, distance);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -503,8 +472,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置当前任务终点
|
||||
*
|
||||
* @param subTaskCoordinate
|
||||
*/
|
||||
public void setCurrentTaskEndMarker(LatLng subTaskCoordinate) {
|
||||
if (mMapWeltView != null) {
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/huanwei"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import android.widget.ImageView;
|
||||
|
||||
import com.amap.api.maps.model.LatLng;
|
||||
import com.amap.api.navi.model.NaviLatLng;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.mvp.IView;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
@@ -17,7 +16,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxButtonView;
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView;
|
||||
@@ -27,8 +25,6 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.listener.IMogoMapListener;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.och.common.module.map.AmapNaviToDestinationModel;
|
||||
import com.mogo.och.sweeper.R;
|
||||
@@ -171,8 +167,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置任务进度
|
||||
*
|
||||
* @param progress
|
||||
*/
|
||||
protected void setTaskProgress(String progress) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
@@ -256,9 +250,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().registerHostMapListener(TAG, this);
|
||||
mCloseNavIcon.setOnClickListener(this);
|
||||
mRefreshNavi.setOnClickListener(this);
|
||||
mMapWeltView.getSwitchToBig().setOnClickListener((v) -> {
|
||||
showOrHideOverMapViewFragment(true);
|
||||
});
|
||||
mMapWeltView.getSwitchToBig().setOnClickListener((v) -> showOrHideOverMapViewFragment(true));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -270,15 +262,11 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 模拟自动驾驶返回状态
|
||||
*
|
||||
* @param status
|
||||
*/
|
||||
public abstract void debugAutoPilotStatus(int status);
|
||||
|
||||
/**
|
||||
* 迈速表实时更新
|
||||
*
|
||||
* @param newSpeed
|
||||
*/
|
||||
public void updateSpeedView(float newSpeed) {
|
||||
int speed = (int) (Math.abs(newSpeed) * 3.6F); // 倒车时工控机反馈定位信息中speed为负值
|
||||
@@ -289,8 +277,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 车辆基本信息View
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public SweeperTrafficDataView getTrafficDataView() {
|
||||
return mTrafficDataView;
|
||||
@@ -351,10 +337,7 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
}
|
||||
}
|
||||
});
|
||||
mSettingBtn.setOnClickListener(v -> {
|
||||
// TODO: 2021/12/9
|
||||
CallerHmiManager.INSTANCE.showToolsView();
|
||||
});
|
||||
mSettingBtn.setOnClickListener(v -> CallerHmiManager.INSTANCE.showToolsView());
|
||||
if (mCardBtn != null) {
|
||||
CallerDevaToolsManager.INSTANCE.initBadCase(mCardBtn);
|
||||
}
|
||||
@@ -412,8 +395,6 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置作业任务全览图隐藏或者显示
|
||||
*
|
||||
* @param isShow
|
||||
*/
|
||||
public void showOrHideOverMapViewFragment(boolean isShow) {
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
@@ -459,20 +440,15 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
|
||||
/**
|
||||
* 设置贴边数据到地图
|
||||
*
|
||||
* @param weltDataBeans
|
||||
*/
|
||||
public void setWeltDataToMap(ArrayList<WeltDataBean> weltDataBeans, Boolean isWeltData, String distance) {
|
||||
mWeltDataBeanList = weltDataBeans;
|
||||
ThreadUtils.getSinglePool().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mMapWeltView != null) {
|
||||
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
|
||||
}
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setWeltData(weltDataBeans, distance);
|
||||
}
|
||||
ThreadUtils.getSinglePool().execute(() -> {
|
||||
if (mMapWeltView != null) {
|
||||
mMapWeltView.setWeltData(weltDataBeans, isWeltData, distance);
|
||||
}
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setWeltData(weltDataBeans, distance);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -524,13 +500,10 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
|
||||
*/
|
||||
public void setTaskRouteList(ArrayList<SweeperRoutePlanningUpdateReqBean.Result> routeList) {
|
||||
mRouteList = routeList;
|
||||
ThreadUtils.getSinglePool().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mMapWeltView.setRouteList(routeList);
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setRouteList(routeList);
|
||||
}
|
||||
ThreadUtils.getSinglePool().execute(() -> {
|
||||
mMapWeltView.setRouteList(routeList);
|
||||
if (mTaskDataToFragmentCallback != null) {
|
||||
mTaskDataToFragmentCallback.setRouteList(routeList);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
<com.mogo.eagle.core.function.view.MapBizView
|
||||
android:id="@+id/mapBizView"
|
||||
app:isWeatherEnable="false"
|
||||
app:locationIcon3DRes="@raw/huanwei"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ ext {
|
||||
btrace : "com.bytedance.btrace:rhea-core:2.0.0",
|
||||
|
||||
mofang_runtime : "com.mogo.eagle.core.mofang:runtime:2.0.6",
|
||||
log_runtime : "com.mogo.eagle.core.log.record:runtime:1.0.6",
|
||||
log_runtime : "com.mogo.eagle.core.log.record:runtime:1.0.8",
|
||||
|
||||
// 安全证书
|
||||
passport_secret : "com.zhidaoauto:sdk-java:1.0.5-SNAPSHOT",
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.mogo.eagle.function.biz.v2x.v2n.scenario.impl;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.entity.V2XMessageEntity;
|
||||
@@ -26,24 +24,19 @@ import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
* version: 1.0
|
||||
*/
|
||||
public class V2XScenarioManager implements IV2XScenarioManager {
|
||||
private static V2XScenarioManager mV2XScenarioManager;
|
||||
private static final String TAG = "V2XScenarioManager";
|
||||
private AbsV2XScenario mV2XScenario = null;
|
||||
|
||||
private V2XScenarioManager() {
|
||||
}
|
||||
|
||||
public static V2XScenarioManager getInstance() {
|
||||
if (mV2XScenarioManager == null) {
|
||||
synchronized (V2XScenarioManager.class) {
|
||||
if (mV2XScenarioManager == null) {
|
||||
mV2XScenarioManager = new V2XScenarioManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return mV2XScenarioManager;
|
||||
private static final class MV2XScenarioManagerHolder {
|
||||
static final V2XScenarioManager mV2XScenarioManager = new V2XScenarioManager();
|
||||
}
|
||||
|
||||
public static V2XScenarioManager getInstance() {
|
||||
return MV2XScenarioManagerHolder.mV2XScenarioManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerMessage(V2XMessageEntity v2XMessageEntity) {
|
||||
|
||||
@@ -116,15 +116,15 @@ class AiRoadMarker {
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 3 --- return ----", "")
|
||||
return@post
|
||||
}
|
||||
if(l1.points.isEmpty() || l2.points.isEmpty()){
|
||||
if(l1!!.points.isEmpty() || l2!!.points.isEmpty()){
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 3 --- return ----", "")
|
||||
return@post
|
||||
}
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 4 --- l2:", l2)
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 4 --- l2:", l2!!)
|
||||
val points = LinkedList<MogoLatLng>()
|
||||
if (l2 != null && l2.points.isNotEmpty()) {
|
||||
points.addAll(l2.points.reversed().map {
|
||||
MogoLatLng(it.second, it.first)
|
||||
if (l2 != null && l2!!.points.isNotEmpty()) {
|
||||
points.addAll(l2!!.points.reversed().map {
|
||||
MogoLatLng(it.latitude, it.longitude)
|
||||
})
|
||||
}
|
||||
val centerX = marker.poi_lon
|
||||
@@ -150,17 +150,17 @@ class AiRoadMarker {
|
||||
} ?: MogoLatLng(centerY, centerX)
|
||||
marker.farthestPoint = Pair(farthestPoint.lon, farthestPoint.lat)
|
||||
V2XBizTrace.onAck("$TAG --- marker --- 6 --- marker:", marker)
|
||||
if (l1 != null && l1.points.isNotEmpty()) {
|
||||
for (l in l1.points) {
|
||||
if (l1 != null && l1!!.points.isNotEmpty()) {
|
||||
for (l in l1!!.points) {
|
||||
if (DrivingDirectionUtils.getDegreeOfCar2Poi2(
|
||||
farthestPoint.lon,
|
||||
farthestPoint.lat,
|
||||
l.first,
|
||||
l.second,
|
||||
l.longitude,
|
||||
l.latitude,
|
||||
(location.heading + 180)
|
||||
) < 90L
|
||||
) {
|
||||
points.add(l.let { MogoLatLng(it.second, it.first) })
|
||||
points.add(l.let { MogoLatLng(it.latitude, it.longitude) })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,6 +294,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun initView() {
|
||||
post {
|
||||
val maxHeight = ScreenUtils.getScreenHeight() - BarUtils.getStatusBarHeight()
|
||||
@@ -1033,7 +1034,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
//设置连接司机屏IP
|
||||
btnConnectServerIp.setOnClickListener {
|
||||
val ip = etConnectServerIp.text.toString()
|
||||
if (!ip.isNullOrEmpty()) {
|
||||
if (!ip.isEmpty()) {
|
||||
CallerAutoPilotControlManager.connectSpecifiedServer(ip)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.mogo.eagle.core.function.main
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.provider.Settings
|
||||
import android.view.*
|
||||
import android.widget.FrameLayout
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.kwai.koom.base.MonitorManager.addMonitorConfig
|
||||
import com.kwai.koom.nativeoom.leakmonitor.LeakListener
|
||||
@@ -84,14 +81,12 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
initConnectInfoRV()
|
||||
CallerHmiManager.init(this)
|
||||
|
||||
//申请悬浮窗权限
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
// 检查是否有悬浮窗权限
|
||||
if (Settings.canDrawOverlays(this)) {
|
||||
return
|
||||
}
|
||||
PermissionsDialogUtils.openAppDetails(this, "显示悬浮窗", REQUEST_CODE_DIALOG)
|
||||
// 检查是否有悬浮窗权限
|
||||
if (Settings.canDrawOverlays(this)) {
|
||||
return
|
||||
}
|
||||
//申请悬浮窗权限
|
||||
PermissionsDialogUtils.openAppDetails(this, "显示悬浮窗", REQUEST_CODE_DIALOG)
|
||||
}
|
||||
|
||||
private fun injectStatusBar() {
|
||||
@@ -116,7 +111,6 @@ open class MainActivity : MvpActivity<MainView?, MainPresenter?>(), MainView,
|
||||
decorView.addView(statusBarView, statusBarLP)
|
||||
}
|
||||
|
||||
|
||||
// todo 优化 车聊聊
|
||||
private fun injectFloatView() {
|
||||
val decorView = this.window.decorView as? FrameLayout ?: return
|
||||
|
||||
@@ -5,9 +5,9 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPointCloudListener
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPointCloudListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper
|
||||
import java.math.BigDecimal
|
||||
|
||||
/**
|
||||
@@ -47,26 +47,20 @@ class MapPointCloudSubscriber private constructor()
|
||||
if (!isDrawPointCloud) {
|
||||
CallerLogger.d(M_MAP + TAG, "====开启点云渲染====")
|
||||
isDrawPointCloud = true
|
||||
PointCloudHelper.setIsDrawPointCloud(true)//打开点云绘制
|
||||
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(true)
|
||||
}
|
||||
PointCloudHelper.setIsDrawPointCloud(true)//打开点云绘制
|
||||
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(true) //打开点云绘制
|
||||
|
||||
/**
|
||||
* 更新点云数据
|
||||
* @param dataStr 点云数据
|
||||
* @param isTrasformer 是否需要转换坐标
|
||||
* @param isResidual 是否需要差量更新
|
||||
* @param isStrong 是否加粗显示
|
||||
* @return 是否执行
|
||||
*/
|
||||
CallerLogger.d(M_MAP + TAG, "====开始传入地图点云数据====")
|
||||
val result = PointCloudHelper.updatePointCloudDataByPb(pointCloud, true, false, false)
|
||||
val result = CallerMapUIServiceManager.getMapUIController()?.updatePointCloud(pointCloud,
|
||||
isTrasformer = true, isResidual = false, isReset = false
|
||||
)
|
||||
CallerLogger.d(M_MAP + TAG, "====结束传入地图点云数据=====$result")
|
||||
} else {
|
||||
if (isDrawPointCloud) {
|
||||
CallerLogger.d(M_MAP + TAG, "====停止点云绘制====")
|
||||
isDrawPointCloud = false
|
||||
PointCloudHelper.setIsDrawPointCloud(false)//停止点云绘制
|
||||
CallerMapUIServiceManager.getMapUIController()?.setIsDrawPointCloud(false)//停止点云绘制
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
@@ -83,10 +77,10 @@ class MapPointCloudSubscriber private constructor()
|
||||
// MAP_RoboBus_B1_3.3.0_lxw_20230526_old_dev
|
||||
val dockerVersionName = AppConfigInfo.dockerVersion
|
||||
// "." 分割,取前两位
|
||||
val dockerVersionNameArray = dockerVersionName?.split(".")
|
||||
val dockerVersionNameArray = dockerVersionName.split(".")
|
||||
|
||||
var dockerVersionCode = ""
|
||||
dockerVersionNameArray?.let {
|
||||
dockerVersionNameArray.let {
|
||||
if (it.size >= 3) {
|
||||
for (index in 0 until 3) {
|
||||
dockerVersionCode +=
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.business.ai
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.Message
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
@@ -68,7 +69,7 @@ class AiCloudIdentifyDataManager : IMoGoPlanningRottingListener,
|
||||
@Volatile
|
||||
private var cloudDataSize = 0
|
||||
|
||||
private val handler = Handler {
|
||||
private val handler = Handler(Looper.getMainLooper()) {
|
||||
if (it.what == H_ERROR_CLOUD) {
|
||||
if (!aiCloudDataChange.get()) {
|
||||
MapBizTrace.log(
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.map.MogoData.Companion.mogoMapData
|
||||
|
||||
//todo emaArrow 多实例影响到的业务,进行测试
|
||||
object CacheHDMapManager {
|
||||
|
||||
private const val TAG = "CacheHDMapManager"
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.mogo.map.MoGoOverlayManager.overlay
|
||||
import com.mogo.map.location.GDLocationClient.Companion.gdLocationClient
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.map.IMogoMapService
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager
|
||||
import com.mogo.map.MogoMap.Companion.mapInstance
|
||||
@@ -22,7 +21,7 @@ import com.mogo.map.location.IMogoGDLocationClient
|
||||
@Route(path = MogoServicePaths.PATH_SERVICES_MAP)
|
||||
class MogoMapService : IMogoMapService {
|
||||
|
||||
override fun getMapUIController(mapTag:String): IMogoMapUIController {
|
||||
override fun getMapUIController(mapTag:String): IMogoMapUIController? {
|
||||
return mapInstance.getMogoMap().uiController
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Liste
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.map.MogoMapView
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController
|
||||
@@ -79,9 +78,9 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
if (skinMode == 0) {
|
||||
getUI().stepInVrMode(false)
|
||||
getUI().stepInDayMode(false)
|
||||
} else if (skinMode == 1) {
|
||||
getUI().stepInVrMode(true)
|
||||
getUI().stepInDayMode(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,51 +1,16 @@
|
||||
package com.mogo.eagle.core.data.constants;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/28
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class DataTypes {
|
||||
|
||||
/**
|
||||
* 识别感知和云端感知数据,全部标记为Marker融合数据
|
||||
*/
|
||||
public static final String TYPE_MARKER_MERGE = "TYPE_MARKER_MERGE";
|
||||
public class DataTypes {
|
||||
|
||||
/**
|
||||
* adas识别数据,Mock用
|
||||
*/
|
||||
public static final String TYPE_MARKER_ADAS = "TYPE_MARKER_ADAS";
|
||||
|
||||
/**
|
||||
* 云端下发数据,Mock用
|
||||
*/
|
||||
public static final String TYPE_MARKER_CLOUD_DATA = "TYPE_MARKER_CLOUD_DATA";
|
||||
|
||||
/**
|
||||
* 云端下发识别目标物警告数据
|
||||
*/
|
||||
public static final String TYPE_MARKER_CLOUD_WARN_DATA = "TYPE_MARKER_CLOUD_WARN_DATA";
|
||||
|
||||
/**
|
||||
* 云端下发停止线数据
|
||||
*/
|
||||
public static final String TYPE_MARKER_CLOUD_STOP_LINE_DATA = "TYPE_MARKER_CLOUD_STOP_LINE_DATA";
|
||||
|
||||
/**
|
||||
* Push 事件场景 VR
|
||||
*/
|
||||
public static final String TYPE_MARKER_PUSH_DATA = "TYPE_MARKER_PUSH_DATA";
|
||||
|
||||
/**
|
||||
*OBU 识别的交通元素
|
||||
*/
|
||||
public static final String TYPE_MARKER_OBU_DATA = "TYPE_MARKER_OBU_DATA";
|
||||
|
||||
/**
|
||||
* 道路事件预警 水滴状道路事件类型替换为3D模型
|
||||
*/
|
||||
public static final String TYPE_MARKER_ROAD_WARNING_TYPE = "TYPE_MARKER_ROAD_WARNING_TYPE";
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.mogo.eagle.core.data.constants;
|
||||
|
||||
/**
|
||||
* 数据库常量
|
||||
*/
|
||||
public class RoomConstants {
|
||||
public static final String DB_NAME_V2X = "MoGoScenario.db";
|
||||
public static final String TB_NAME_SCENARIO = "tb_travel_scenario";
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.mogo.eagle.core.data.map
|
||||
|
||||
|
||||
/**
|
||||
* 道路中心经纬度集合
|
||||
*/
|
||||
class CenterLine {
|
||||
var id = "" //id
|
||||
var tile_id = "" //瓦片id
|
||||
var road_id = ""//道路id
|
||||
var lane_id = ""//车道id
|
||||
var points: ArrayList<LonLatPoint>? = null//道路经纬度
|
||||
var angle: Double? = 0.0//车道线id
|
||||
override fun toString(): String {
|
||||
return "CenterLine(id='$id', tile_id='$tile_id', road_id='$road_id', lane_id='$lane_id', points=$points, angle=$angle)"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
package com.mogo.eagle.core.data.map;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class LonLatPoint implements Serializable {
|
||||
|
||||
private double longitude;
|
||||
private double latitude;
|
||||
private double altitude;
|
||||
private int duration;
|
||||
private double angle = 0;
|
||||
private String provider;
|
||||
private double distance;
|
||||
private double speed;
|
||||
|
||||
public LonLatPoint() {
|
||||
}
|
||||
|
||||
public LonLatPoint(double longitude, double latitude) {
|
||||
this.longitude = longitude;
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public LonLatPoint(double longitude, double latitude, double angle) {
|
||||
this.longitude = longitude;
|
||||
this.latitude = latitude;
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public LonLatPoint(double longitude, double latitude, double altitude, double angle) {
|
||||
this.longitude = longitude;
|
||||
this.latitude = latitude;
|
||||
this.altitude = altitude;
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
public void setProvider(String provider) {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public double getAltitude() {
|
||||
return altitude;
|
||||
}
|
||||
|
||||
public void setAltitude(double altitude) {
|
||||
this.altitude = altitude;
|
||||
}
|
||||
|
||||
public double getAngle() {
|
||||
return angle;
|
||||
}
|
||||
|
||||
public void setAngle(double angle) {
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public double getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance(double distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public double getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(double speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LonLatPoint{" +
|
||||
"longitude=" + longitude +
|
||||
", latitude=" + latitude +
|
||||
", altitude=" + altitude +
|
||||
", angle=" + angle +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
package com.mogo.eagle.core.data.map;
|
||||
|
||||
/**
|
||||
* poi信息封装
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class PoiWrapper {
|
||||
private int id;
|
||||
private String poiType;
|
||||
private int iconRes;
|
||||
private int iconInfoRes;
|
||||
private String iconUrl = "";
|
||||
// "https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/VN000012.jpg";
|
||||
private String iconInfoUrl = "";
|
||||
// "http://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/sso-server-image/1596705960869.png";
|
||||
private String title = "拥堵";
|
||||
|
||||
public PoiWrapper(){
|
||||
|
||||
}
|
||||
|
||||
public PoiWrapper(String poiType, int iconRes, int iconInfoRes, String title) {
|
||||
this.poiType = poiType;
|
||||
this.iconRes = iconRes;
|
||||
this.iconInfoRes = iconInfoRes;
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPoiType() {
|
||||
return poiType;
|
||||
}
|
||||
|
||||
public void setPoiType(String poiType) {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public int getIconRes() {
|
||||
return iconRes;
|
||||
}
|
||||
|
||||
public void setIconRes(int iconRes) {
|
||||
this.iconRes = iconRes;
|
||||
}
|
||||
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
public void setIconUrl(String iconUrl) {
|
||||
this.iconUrl = iconUrl;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public int getIconInfoRes() {
|
||||
return iconInfoRes;
|
||||
}
|
||||
|
||||
public void setIconInfoRes(int iconInfoRes) {
|
||||
this.iconInfoRes = iconInfoRes;
|
||||
}
|
||||
|
||||
public String getIconInfoUrl() {
|
||||
return iconInfoUrl;
|
||||
}
|
||||
|
||||
public void setIconInfoUrl(String iconInfoUrl) {
|
||||
this.iconInfoUrl = iconInfoUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PoiWrapper{" +
|
||||
"poiType='" + poiType + '\'' +
|
||||
", iconRes=" + iconRes +
|
||||
", iconInfoRes=" + iconInfoRes +
|
||||
", iconUrl='" + iconUrl + '\'' +
|
||||
", iconInfoUrl='" + iconInfoUrl + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerActivitiesScope implements Serializable {
|
||||
|
||||
private String content;
|
||||
private boolean isCheck;
|
||||
|
||||
public String getContent() {
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
return "";
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public boolean getIsCheck() {
|
||||
return isCheck;
|
||||
}
|
||||
|
||||
public void setIsCheck(boolean isCheck) {
|
||||
this.isCheck = isCheck;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerActivitiesScope{" +
|
||||
"content='" + content + '\'' +
|
||||
", isCheck=" + isCheck +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerCarChat implements Serializable {
|
||||
|
||||
private String type;
|
||||
private MarkerLocation location;
|
||||
private MarkerUserInfo userInfo;
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public MarkerUserInfo getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUserInfo(MarkerUserInfo userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerCarChat{" +
|
||||
"location=" + location +
|
||||
", type='" + type + '\'' +
|
||||
", userInfo=" + userInfo +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerCarInfo implements Serializable {
|
||||
|
||||
private String carBrandLogoUrl;
|
||||
private String carTypeName;
|
||||
private int vehicleType;
|
||||
private CarLiveInfo carLiveInfo;
|
||||
|
||||
public String getCarBrandLogoUrl() {
|
||||
if (TextUtils.isEmpty(carBrandLogoUrl)) {
|
||||
return "";
|
||||
}
|
||||
return carBrandLogoUrl;
|
||||
}
|
||||
|
||||
public void setCarBrandLogoUrl(String carBrandLogoUrl) {
|
||||
this.carBrandLogoUrl = carBrandLogoUrl;
|
||||
}
|
||||
|
||||
public String getCarTypeName() {
|
||||
if (TextUtils.isEmpty(carTypeName)) {
|
||||
return "";
|
||||
}
|
||||
return carTypeName;
|
||||
}
|
||||
|
||||
public void setCarTypeName(String carTypeName) {
|
||||
this.carTypeName = carTypeName;
|
||||
}
|
||||
|
||||
public int getVehicleType() {
|
||||
return vehicleType;
|
||||
}
|
||||
|
||||
public void setVehicleType(int vehicleType) {
|
||||
this.vehicleType = vehicleType;
|
||||
}
|
||||
|
||||
public CarLiveInfo getCarLiveInfo() {
|
||||
return carLiveInfo;
|
||||
}
|
||||
|
||||
public void setCarLiveInfo(CarLiveInfo carLiveInfo) {
|
||||
this.carLiveInfo = carLiveInfo;
|
||||
}
|
||||
|
||||
public static class CarLiveInfo implements Serializable {
|
||||
//rtmp视频直播地址rtmp://
|
||||
private String videoUrl;
|
||||
//直播频道【直播心跳接口参数】C_1
|
||||
private String videoChannel;
|
||||
//直播源sn【直播心跳接口参数】XTCBA90740400625
|
||||
private String videoSn;
|
||||
|
||||
public String getVideoUrl() {
|
||||
return videoUrl;
|
||||
}
|
||||
|
||||
public void setVideoUrl(String videoUrl) {
|
||||
this.videoUrl = videoUrl;
|
||||
}
|
||||
|
||||
public String getVideoChannel() {
|
||||
return videoChannel;
|
||||
}
|
||||
|
||||
public void setVideoChannel(String videoChannel) {
|
||||
this.videoChannel = videoChannel;
|
||||
}
|
||||
|
||||
public String getVideoSn() {
|
||||
return videoSn;
|
||||
}
|
||||
|
||||
public void setVideoSn(String videoSn) {
|
||||
this.videoSn = videoSn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CarLiveInfo{" +
|
||||
"videoUrl='" + videoUrl + '\'' +
|
||||
", videoChannel='" + videoChannel + '\'' +
|
||||
", videoSn='" + videoSn + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerCarInfo{" +
|
||||
"carBrandLogoUrl='" + carBrandLogoUrl + '\'' +
|
||||
", carTypeName='" + carTypeName + '\'' +
|
||||
", vehicleType=" + vehicleType +
|
||||
", carLiveInfo=" + carLiveInfo +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ihoudf on 2020-04-16.
|
||||
**/
|
||||
public class MarkerCarPois {
|
||||
|
||||
private List coordinates;
|
||||
private double angle; // 车头角度
|
||||
private String adcode;
|
||||
|
||||
public List getCoordinates() {
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
public void setCoordinates(List coordinates) {
|
||||
this.coordinates = coordinates;
|
||||
}
|
||||
|
||||
public double getAngle() {
|
||||
return angle;
|
||||
}
|
||||
|
||||
public void setAngle(double angle) {
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public String getAdcode() {
|
||||
return adcode;
|
||||
}
|
||||
|
||||
public void setAdcode(String adcode) {
|
||||
this.adcode = adcode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerCarPois{" + "coordinates=" + coordinates + ", angle=" + angle + ", adcode" +
|
||||
"='" + adcode + '\'' + '}';
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerCardResult extends BaseData {
|
||||
|
||||
private List<String> dataType; // 要查询的类型
|
||||
private List<MarkerCarChat> carChat;
|
||||
private List<MarkerShareMusic> shareMusic;
|
||||
private List<MarkerNoveltyInfo> noveltyInfo;
|
||||
|
||||
private List<MarkerOnlineCar> onlineCar;
|
||||
private List<MarkerExploreWay> exploreWay;
|
||||
private long messageTime;
|
||||
|
||||
public List<MarkerCarChat> getCarChat() {
|
||||
return carChat;
|
||||
}
|
||||
|
||||
public void setCarChat(List<MarkerCarChat> carChat) {
|
||||
this.carChat = carChat;
|
||||
}
|
||||
|
||||
public List<MarkerExploreWay> getExploreWay() {
|
||||
return exploreWay;
|
||||
}
|
||||
|
||||
public void setExploreWay(List<MarkerExploreWay> exploreWay) {
|
||||
this.exploreWay = exploreWay;
|
||||
}
|
||||
|
||||
public List<MarkerOnlineCar> getOnlineCar() {
|
||||
return onlineCar;
|
||||
}
|
||||
|
||||
public void setOnlineCar(List<MarkerOnlineCar> onlineCar) {
|
||||
this.onlineCar = onlineCar;
|
||||
}
|
||||
|
||||
public List<MarkerShareMusic> getShareMusic() {
|
||||
return shareMusic;
|
||||
}
|
||||
|
||||
public void setShareMusic(List<MarkerShareMusic> shareMusic) {
|
||||
this.shareMusic = shareMusic;
|
||||
}
|
||||
|
||||
public List<MarkerNoveltyInfo> getNoveltyInfo() {
|
||||
return noveltyInfo;
|
||||
}
|
||||
|
||||
public void setNoveltyInfo(List<MarkerNoveltyInfo> noveltyInfo) {
|
||||
this.noveltyInfo = noveltyInfo;
|
||||
}
|
||||
|
||||
public List<String> getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(List<String> dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public long getMessageTime() {
|
||||
return messageTime;
|
||||
}
|
||||
|
||||
public void setMessageTime(long messageTime) {
|
||||
this.messageTime = messageTime;
|
||||
}
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerDynamicData implements Serializable {
|
||||
//QQ音乐,懒人听书,乐听头条 2 为书籍听书,3 为新闻,1 为qq音乐
|
||||
private int type;
|
||||
private String mediaId;//qq音乐id,书的bookId
|
||||
//qq音乐url 懒人听书为“”
|
||||
private String mediaUrl;
|
||||
//歌曲名 ,当前播放书名,新闻标题内容
|
||||
private String mediaName;
|
||||
//演唱歌手,当前章节,新闻来源
|
||||
private String mediaSinger;
|
||||
//歌曲封面,书籍封面,新闻预览图
|
||||
private String mediaImg;
|
||||
//音乐类别,类似经典 ,流行只有qq特有
|
||||
private String mediaType;
|
||||
private int maxTime;//音频总时长
|
||||
private String bookInfo;//懒人听书json串
|
||||
//当前播放时长,可以不加,播放进度单独独立出来
|
||||
private int curTime;
|
||||
//是否是本地音频,只有qq音乐
|
||||
private boolean isLocalMedia;//本地
|
||||
//播放模式,顺序,单曲循环,随机
|
||||
private int mediaPlayMode;
|
||||
//1 播放 2 缓冲 0 暂停/停止 -1 播放错误
|
||||
private int playState;
|
||||
|
||||
public String getMediaId() {
|
||||
return mediaId;
|
||||
}
|
||||
|
||||
public void setMediaId(String mediaId) {
|
||||
this.mediaId = mediaId;
|
||||
}
|
||||
|
||||
public String getMediaUrl() {
|
||||
return mediaUrl;
|
||||
}
|
||||
|
||||
public void setMediaUrl(String mediaUrl) {
|
||||
this.mediaUrl = mediaUrl;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getPlayState() {
|
||||
return playState;
|
||||
}
|
||||
|
||||
public void setPlayState(int playState) {
|
||||
this.playState = playState;
|
||||
}
|
||||
|
||||
public String getMediaName() {
|
||||
if (TextUtils.isEmpty(mediaName)) {
|
||||
return "";
|
||||
}
|
||||
return mediaName;
|
||||
}
|
||||
|
||||
public void setMediaName(String mediaName) {
|
||||
this.mediaName = mediaName;
|
||||
}
|
||||
|
||||
public String getMediaSinger() {
|
||||
if (TextUtils.isEmpty(mediaSinger)) {
|
||||
return "";
|
||||
}
|
||||
return mediaSinger;
|
||||
}
|
||||
|
||||
public void setMediaSinger(String mediaSinger) {
|
||||
this.mediaSinger = mediaSinger;
|
||||
}
|
||||
|
||||
public String getMediaImg() {
|
||||
return mediaImg;
|
||||
}
|
||||
|
||||
public void setMediaImg(String mediaImg) {
|
||||
this.mediaImg = mediaImg;
|
||||
}
|
||||
|
||||
public long getMaxTime() {
|
||||
return maxTime;
|
||||
}
|
||||
|
||||
public void setMaxTime(int maxTime) {
|
||||
this.maxTime = maxTime;
|
||||
}
|
||||
|
||||
public long getCurTime() {
|
||||
return curTime;
|
||||
}
|
||||
|
||||
public void setCurTime(int curTime) {
|
||||
this.curTime = curTime;
|
||||
}
|
||||
|
||||
public String getMediaType() {
|
||||
if (TextUtils.isEmpty(mediaType)) {
|
||||
return "";
|
||||
}
|
||||
return mediaType;
|
||||
}
|
||||
|
||||
public void setMediaType(String mediaType) {
|
||||
this.mediaType = mediaType;
|
||||
}
|
||||
|
||||
public boolean isLocalMedia() {
|
||||
return isLocalMedia;
|
||||
}
|
||||
|
||||
public void setLocalMedia(boolean localMedia) {
|
||||
isLocalMedia = localMedia;
|
||||
}
|
||||
|
||||
public int getMediaPlayMode() {
|
||||
return mediaPlayMode;
|
||||
}
|
||||
|
||||
public void setMediaPlayMode(int mediaPlayMode) {
|
||||
this.mediaPlayMode = mediaPlayMode;
|
||||
}
|
||||
|
||||
public String getBookInfo() {
|
||||
return bookInfo;
|
||||
}
|
||||
|
||||
public void setBookInfo(String bookInfo) {
|
||||
this.bookInfo = bookInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerDynamicData{" +
|
||||
"type=" + type +
|
||||
", mediaId='" + mediaId + '\'' +
|
||||
", mediaUrl='" + mediaUrl + '\'' +
|
||||
", mediaName='" + mediaName + '\'' +
|
||||
", mediaSinger='" + mediaSinger + '\'' +
|
||||
", mediaImg='" + mediaImg + '\'' +
|
||||
", mediaType='" + mediaType + '\'' +
|
||||
", maxTime=" + maxTime +
|
||||
", bookInfo='" + bookInfo + '\'' +
|
||||
", curTime=" + curTime +
|
||||
", isLocalMedia=" + isLocalMedia +
|
||||
", mediaPlayMode=" + mediaPlayMode +
|
||||
", playState=" + playState +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020-01-1615:12
|
||||
* desc : 爱好
|
||||
* version: 1.0
|
||||
*/
|
||||
public class MarkerHobbyDatum implements Serializable {
|
||||
private List<MarkerOnlineTag> singerTop2; // 最喜欢的两位歌手
|
||||
private List<MarkerOnlineTag> songTypeTop2; // 最喜欢的两种音乐类型
|
||||
private List<MarkerOnlineTag> newsType; // 最喜欢的资讯类型
|
||||
private List<MarkerOnlineTag> listenBookTop2; // 最喜欢听的两本书
|
||||
private List<MarkerOnlineTag> ifSociety; // 是否喜爱社交
|
||||
|
||||
|
||||
public List<MarkerOnlineTag> getSingerTop2() {
|
||||
return singerTop2;
|
||||
}
|
||||
|
||||
public void setSingerTop2(List<MarkerOnlineTag> singerTop2) {
|
||||
this.singerTop2 = singerTop2;
|
||||
}
|
||||
|
||||
public List<MarkerOnlineTag> getSongTypeTop2() {
|
||||
return songTypeTop2;
|
||||
}
|
||||
|
||||
public void setSongTypeTop2(List<MarkerOnlineTag> songTypeTop2) {
|
||||
this.songTypeTop2 = songTypeTop2;
|
||||
}
|
||||
|
||||
public List<MarkerOnlineTag> getNewsType() {
|
||||
return newsType;
|
||||
}
|
||||
|
||||
public void setNewsType(List<MarkerOnlineTag> newsType) {
|
||||
this.newsType = newsType;
|
||||
}
|
||||
|
||||
public List<MarkerOnlineTag> getListenBookTop2() {
|
||||
return listenBookTop2;
|
||||
}
|
||||
|
||||
public void setListenBookTop2(List<MarkerOnlineTag> listenBookTop2) {
|
||||
this.listenBookTop2 = listenBookTop2;
|
||||
}
|
||||
|
||||
public List<MarkerOnlineTag> getIfSociety() {
|
||||
return ifSociety;
|
||||
}
|
||||
|
||||
public void setIfSociety(List<MarkerOnlineTag> ifSociety) {
|
||||
this.ifSociety = ifSociety;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerHobbyDatum{" +
|
||||
"singerTop2=" + singerTop2 +
|
||||
", songTypeTop2=" + songTypeTop2 +
|
||||
", newsType=" + newsType +
|
||||
", listenBookTop2=" + listenBookTop2 +
|
||||
", ifSociety=" + ifSociety +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
/**
|
||||
* 新鲜事儿Marker数据
|
||||
*/
|
||||
public class MarkerNoveltyInfo {
|
||||
private String type;
|
||||
private String sn;
|
||||
private MarkerLocation location;
|
||||
private String poiType;
|
||||
private ContentData contentData;
|
||||
|
||||
public ContentData getContentData() {
|
||||
return contentData;
|
||||
}
|
||||
|
||||
public void setContentData(ContentData contentData) {
|
||||
this.contentData = contentData;
|
||||
}
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getPoiType() {
|
||||
return poiType;
|
||||
}
|
||||
|
||||
public void setPoiType(String poiType) {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public static class ContentData {
|
||||
private String content;
|
||||
private String iconUrl;
|
||||
private String imgUrl;
|
||||
private String infoId;
|
||||
private long likeNum;
|
||||
private String title;
|
||||
private String gasPrices;
|
||||
private boolean displayNavigation;
|
||||
private boolean desplayHost;
|
||||
private boolean fabulous;
|
||||
private String styleType;
|
||||
//上报类型:1-用户上报,2-后台上报 3-三方上报
|
||||
private String uploadType;
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
public void setIconUrl(String iconUrl) {
|
||||
this.iconUrl = iconUrl;
|
||||
}
|
||||
|
||||
public String getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
public void setImgUrl(String imgUrl) {
|
||||
this.imgUrl = imgUrl;
|
||||
}
|
||||
|
||||
public String getInfoId() {
|
||||
return infoId;
|
||||
}
|
||||
|
||||
public void setInfoId(String infoId) {
|
||||
this.infoId = infoId;
|
||||
}
|
||||
|
||||
public long getLikeNum() {
|
||||
return likeNum;
|
||||
}
|
||||
|
||||
public void setLikeNum(long likeNum) {
|
||||
this.likeNum = likeNum;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public boolean isDisplayNavigation() {
|
||||
return displayNavigation;
|
||||
}
|
||||
|
||||
public void setDisplayNavigation(boolean displayNavigation) {
|
||||
this.displayNavigation = displayNavigation;
|
||||
}
|
||||
|
||||
public String getStyleType() {
|
||||
return styleType;
|
||||
}
|
||||
|
||||
public void setStyleType(String styleType) {
|
||||
this.styleType = styleType;
|
||||
}
|
||||
|
||||
public String getGasPrices() {
|
||||
return gasPrices;
|
||||
}
|
||||
|
||||
public void setGasPrices(String gasPrices) {
|
||||
this.gasPrices = gasPrices;
|
||||
}
|
||||
|
||||
public boolean isDesplayHost() {
|
||||
return desplayHost;
|
||||
}
|
||||
|
||||
public void setDesplayHost(boolean desplayHost) {
|
||||
this.desplayHost = desplayHost;
|
||||
}
|
||||
|
||||
public boolean isFabulous() {
|
||||
return fabulous;
|
||||
}
|
||||
|
||||
public void setFabulous(boolean fabulous) {
|
||||
this.fabulous = fabulous;
|
||||
}
|
||||
|
||||
public String getUploadType() {
|
||||
return uploadType;
|
||||
}
|
||||
|
||||
public void setUploadType(String uploadType) {
|
||||
this.uploadType = uploadType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ContentData{" +
|
||||
"content='" + content + '\'' +
|
||||
", iconUrl='" + iconUrl + '\'' +
|
||||
", imgUrl='" + imgUrl + '\'' +
|
||||
", infoId='" + infoId + '\'' +
|
||||
", likeNum=" + likeNum +
|
||||
", title='" + title + '\'' +
|
||||
", gasPrices='" + gasPrices + '\'' +
|
||||
", displayNavigation=" + displayNavigation +
|
||||
", desplayHost=" + desplayHost +
|
||||
", fabulous=" + fabulous +
|
||||
", styleType='" + styleType + '\'' +
|
||||
", uploadType='" + uploadType + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerNoveltyInfo{" +
|
||||
"type='" + type + '\'' +
|
||||
", sn='" + sn + '\'' +
|
||||
", location=" + location +
|
||||
", poiType='" + poiType + '\'' +
|
||||
", contentData=" + contentData +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MarkerOnlineCar implements Serializable {
|
||||
|
||||
private String type;//卡片类型
|
||||
private MarkerLocation location;//所在位置
|
||||
private Boolean isFocus;//isFocus":"0-未关注,1-关注
|
||||
private MarkerUserInfo userInfo;//用户数据
|
||||
private MarkerCarInfo carInfo;//车辆数据
|
||||
private List<MarkerCarPois> pois;//车辆路线
|
||||
private MarkerDynamicData dynamicData;//动态数据
|
||||
private MarkerHobbyDatum hobbyData;//爱好数据集合
|
||||
private List<MarkerActivitiesScope> activitiesScope;//活动范围数据集合
|
||||
private int compatibility;//匹配度
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public Boolean getFocus() {
|
||||
return isFocus;
|
||||
}
|
||||
|
||||
public void setFocus(Boolean focus) {
|
||||
isFocus = focus;
|
||||
}
|
||||
|
||||
public MarkerUserInfo getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUserInfo(MarkerUserInfo userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
public MarkerCarInfo getCarInfo() {
|
||||
return carInfo;
|
||||
}
|
||||
|
||||
public void setCarInfo(MarkerCarInfo carInfo) {
|
||||
this.carInfo = carInfo;
|
||||
}
|
||||
|
||||
public List<MarkerCarPois> getPois() {
|
||||
return pois;
|
||||
}
|
||||
|
||||
public void setPois(List<MarkerCarPois> pois) {
|
||||
this.pois = pois;
|
||||
}
|
||||
|
||||
public MarkerDynamicData getDynamicData() {
|
||||
return dynamicData;
|
||||
}
|
||||
|
||||
public void setDynamicData(MarkerDynamicData dynamicData) {
|
||||
this.dynamicData = dynamicData;
|
||||
}
|
||||
|
||||
public MarkerHobbyDatum getHobbyData() {
|
||||
return hobbyData;
|
||||
}
|
||||
|
||||
public void setHobbyData(MarkerHobbyDatum hobbyData) {
|
||||
this.hobbyData = hobbyData;
|
||||
}
|
||||
|
||||
public List<MarkerActivitiesScope> getActivitiesScope() {
|
||||
return activitiesScope;
|
||||
}
|
||||
|
||||
public void setActivitiesScope(List<MarkerActivitiesScope> activitiesScope) {
|
||||
this.activitiesScope = activitiesScope;
|
||||
}
|
||||
|
||||
public int getCompatibility() {
|
||||
return compatibility;
|
||||
}
|
||||
|
||||
public void setCompatibility(int compatibility) {
|
||||
this.compatibility = compatibility;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerOnlineCar{" + "type='" + type + '\'' + ", location=" + location + ", " +
|
||||
"isFocus=" + isFocus + ", userInfo=" + userInfo + ", carInfo=" + carInfo + ", " + "pois=" + pois + ", dynamicData=" + dynamicData + ", hobbyData=" + hobbyData + "," + " activitiesScope=" + activitiesScope + ", compatibility=" + compatibility + '}';
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerOnlineTag implements Serializable {
|
||||
|
||||
private String content;
|
||||
private boolean isCheck;
|
||||
|
||||
public String getContent() {
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
return "";
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public boolean getIsCheck() {
|
||||
return isCheck;
|
||||
}
|
||||
|
||||
public void setIsCheck(boolean isCheck) {
|
||||
this.isCheck = isCheck;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerHobbyDatum{" +
|
||||
"content='" + content + '\'' +
|
||||
", isCheck=" + isCheck +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerResponse extends BaseData implements Serializable {
|
||||
|
||||
// private int code;
|
||||
// private String msg;
|
||||
private MarkerCardResult result;
|
||||
private String sign;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public MarkerCardResult getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public void setResult(MarkerCardResult result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerResponse{" + "result=" + result + ", sign='" + sign + '\'' + ", code=" + code + ", msg='" + msg + '\'' + '}';
|
||||
}
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class MarkerShareMusic implements Serializable {
|
||||
|
||||
private String bookInfo;
|
||||
private int id;
|
||||
private int likeNumber;
|
||||
private MarkerLocation location;
|
||||
private String mediaId;
|
||||
private String mediaImg;
|
||||
private String mediaName;
|
||||
private String mediaSinger;
|
||||
private String mediaUrl;
|
||||
private String shareContentText;
|
||||
private int shareType;
|
||||
private String type;
|
||||
private MarkerUserInfo userInfo;
|
||||
|
||||
public String getBookInfo() {
|
||||
return bookInfo;
|
||||
}
|
||||
|
||||
public void setBookInfo(String bookInfo) {
|
||||
this.bookInfo = bookInfo;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getLikeNumber() {
|
||||
return likeNumber;
|
||||
}
|
||||
|
||||
public void setLikeNumber(int likeNumber) {
|
||||
this.likeNumber = likeNumber;
|
||||
}
|
||||
|
||||
public String getMediaId() {
|
||||
return mediaId;
|
||||
}
|
||||
|
||||
public void setMediaId(String mediaId) {
|
||||
this.mediaId = mediaId;
|
||||
}
|
||||
|
||||
public String getMediaImg() {
|
||||
if (TextUtils.isEmpty(mediaImg)) {
|
||||
return "";
|
||||
}
|
||||
return mediaImg;
|
||||
}
|
||||
|
||||
public void setMediaImg(String mediaImg) {
|
||||
this.mediaImg = mediaImg;
|
||||
}
|
||||
|
||||
public String getMediaName() {
|
||||
if (TextUtils.isEmpty(mediaName)) {
|
||||
return "";
|
||||
}
|
||||
return mediaName;
|
||||
}
|
||||
|
||||
public void setMediaName(String mediaName) {
|
||||
this.mediaName = mediaName;
|
||||
}
|
||||
|
||||
public String getMediaSinger() {
|
||||
return mediaSinger;
|
||||
}
|
||||
|
||||
public void setMediaSinger(String mediaSinger) {
|
||||
this.mediaSinger = mediaSinger;
|
||||
}
|
||||
|
||||
public String getMediaUrl() {
|
||||
return mediaUrl;
|
||||
}
|
||||
|
||||
public void setMediaUrl(String mediaUrl) {
|
||||
this.mediaUrl = mediaUrl;
|
||||
}
|
||||
|
||||
public String getShareContentText() {
|
||||
return shareContentText;
|
||||
}
|
||||
|
||||
public void setShareContentText(String shareContentText) {
|
||||
this.shareContentText = shareContentText;
|
||||
}
|
||||
|
||||
public int getShareType() {
|
||||
return shareType;
|
||||
}
|
||||
|
||||
public void setShareType(int shareType) {
|
||||
this.shareType = shareType;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public MarkerUserInfo getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUserInfo(MarkerUserInfo userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerShareMusic{" +
|
||||
"bookInfo='" + bookInfo + '\'' +
|
||||
", id=" + id +
|
||||
", likeNumber=" + likeNumber +
|
||||
", location=" + location +
|
||||
", mediaId='" + mediaId + '\'' +
|
||||
", mediaImg='" + mediaImg + '\'' +
|
||||
", mediaName='" + mediaName + '\'' +
|
||||
", mediaSinger='" + mediaSinger + '\'' +
|
||||
", mediaUrl='" + mediaUrl + '\'' +
|
||||
", shareContentText='" + shareContentText + '\'' +
|
||||
", shareType=" + shareType +
|
||||
", type='" + type + '\'' +
|
||||
", userInfo=" + userInfo +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
* e-mail : 1358506549@qq.com
|
||||
* date : 2020-01-1015:47
|
||||
* desc : 用来跟Marker View 绑定使用,内容、状态等设置
|
||||
* version: 1.0
|
||||
*/
|
||||
public class MarkerShowEntity {
|
||||
|
||||
// false - 没选中,true - 选中
|
||||
private boolean isChecked;
|
||||
// false - 非高亮,true - 高亮
|
||||
private boolean isHighlighted;
|
||||
// icon 地址,例如:头像,唱片图片,探路缩略,可能为空展示默认图
|
||||
private String iconUrl;
|
||||
// 要展示的文本
|
||||
private String textContent;
|
||||
// Marker 类型
|
||||
private String markerType;
|
||||
// 绑定 MarkerView 的数据
|
||||
private Object bindObj;
|
||||
//Marker 经纬度位置信息
|
||||
private MarkerLocation markerLocation;
|
||||
|
||||
public boolean isChecked() {
|
||||
return isChecked;
|
||||
}
|
||||
|
||||
public void setChecked(boolean checked) {
|
||||
isChecked = checked;
|
||||
}
|
||||
|
||||
public boolean isHighlighted() {
|
||||
return isHighlighted;
|
||||
}
|
||||
|
||||
public void setHighlighted(boolean highlighted) {
|
||||
isHighlighted = highlighted;
|
||||
}
|
||||
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
public void setIconUrl(String iconUrl) {
|
||||
this.iconUrl = iconUrl;
|
||||
}
|
||||
|
||||
public String getTextContent() {
|
||||
if (TextUtils.isEmpty(textContent)) {
|
||||
return "";
|
||||
}
|
||||
return textContent;
|
||||
}
|
||||
|
||||
public void setTextContent(String textContent) {
|
||||
this.textContent = textContent;
|
||||
}
|
||||
|
||||
public String getMarkerType() {
|
||||
return markerType;
|
||||
}
|
||||
|
||||
public void setMarkerType(String markerType) {
|
||||
this.markerType = markerType;
|
||||
}
|
||||
|
||||
public Object getBindObj() {
|
||||
return bindObj;
|
||||
}
|
||||
|
||||
public void setBindObj(Object bindObj) {
|
||||
this.bindObj = bindObj;
|
||||
}
|
||||
|
||||
public MarkerLocation getMarkerLocation() {
|
||||
return markerLocation;
|
||||
}
|
||||
|
||||
public void setMarkerLocation(MarkerLocation markerLocation) {
|
||||
this.markerLocation = markerLocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
MarkerShowEntity that = (MarkerShowEntity) o;
|
||||
return Objects.equals(iconUrl, that.iconUrl) &&
|
||||
Objects.equals(textContent, that.textContent) &&
|
||||
Objects.equals(markerType, that.markerType) &&
|
||||
Objects.equals(bindObj, that.bindObj) &&
|
||||
Objects.equals(markerLocation, that.markerLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(iconUrl, textContent, markerType, bindObj, markerLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MarkerShowEntity{" +
|
||||
"isChecked=" + isChecked +
|
||||
", isHighlighted=" + isHighlighted +
|
||||
", iconUrl='" + iconUrl + '\'' +
|
||||
", textContent='" + textContent + '\'' +
|
||||
", markerType='" + markerType + '\'' +
|
||||
", bindObj=" + bindObj +
|
||||
", markerLocation=" + markerLocation +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import com.mogo.utils.sqlite.annotation.DbDatabase;
|
||||
import com.mogo.utils.sqlite.annotation.DbField;
|
||||
import com.mogo.utils.sqlite.annotation.DbTable;
|
||||
|
||||
/**
|
||||
* V2X 被点赞的事件
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
@DbDatabase(dbName = "MoGoScenario.db")
|
||||
@DbTable(tableName = "tb_event_zan")
|
||||
public class V2XEventZanData {
|
||||
|
||||
/**
|
||||
* 事件ID
|
||||
*/
|
||||
@DbField(fieldName = "eventId")
|
||||
public String eventId;
|
||||
|
||||
/**
|
||||
* 触发时间
|
||||
*/
|
||||
@DbField(fieldName = "triggerTime")
|
||||
public Long triggerTime;
|
||||
|
||||
public String getEventId() {
|
||||
return eventId;
|
||||
}
|
||||
|
||||
public void setEventId(String eventId) {
|
||||
this.eventId = eventId;
|
||||
}
|
||||
|
||||
public Long getTriggerTime() {
|
||||
return triggerTime;
|
||||
}
|
||||
|
||||
public void setTriggerTime(Long triggerTime) {
|
||||
this.triggerTime = triggerTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "V2XEventZanData{" +
|
||||
"eventId=" + eventId +
|
||||
", triggerTime=" + triggerTime +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import com.mogo.eagle.core.data.constants.RoomConstants;
|
||||
import com.mogo.utils.sqlite.annotation.DbDatabase;
|
||||
import com.mogo.utils.sqlite.annotation.DbField;
|
||||
import com.mogo.utils.sqlite.annotation.DbTable;
|
||||
|
||||
/**
|
||||
* V2X 道路历史事件
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
@DbDatabase(dbName = RoomConstants.DB_NAME_V2X)
|
||||
@DbTable(tableName = RoomConstants.TB_NAME_SCENARIO)
|
||||
public class V2XHistoryScenarioData {
|
||||
|
||||
/**
|
||||
* 事件类型
|
||||
*/
|
||||
@DbField(fieldName = "scenarioType")
|
||||
public Integer scenarioType;
|
||||
|
||||
/**
|
||||
* 事件触发时间
|
||||
*/
|
||||
@DbField(fieldName = "triggerTime")
|
||||
public Long triggerTime;
|
||||
|
||||
/**
|
||||
* 事件json
|
||||
*/
|
||||
@DbField(fieldName = "eventJsonData")
|
||||
public String eventJsonData;
|
||||
|
||||
/**
|
||||
* 事件json HashCode
|
||||
* 只取json中的几个代表性字段,表示唯一性,因为图片地址会经常被改变
|
||||
*/
|
||||
@DbField(fieldName = "eventJsonDataHashCode")
|
||||
public Integer eventJsonDataHashCode;
|
||||
|
||||
/**
|
||||
* 事件是否被处理过了,true-处理过了。false-未处理过
|
||||
*/
|
||||
@DbField(fieldName = "isDispose")
|
||||
public Boolean isDispose;
|
||||
|
||||
public Integer getScenarioType() {
|
||||
return scenarioType;
|
||||
}
|
||||
|
||||
public void setScenarioType(Integer scenarioType) {
|
||||
this.scenarioType = scenarioType;
|
||||
}
|
||||
|
||||
public String getEventJsonData() {
|
||||
return eventJsonData;
|
||||
}
|
||||
|
||||
public void setEventJsonData(String eventJsonData) {
|
||||
this.eventJsonData = eventJsonData;
|
||||
}
|
||||
|
||||
public Long getTriggerTime() {
|
||||
return triggerTime;
|
||||
}
|
||||
|
||||
public void setTriggerTime(Long triggerTime) {
|
||||
this.triggerTime = triggerTime;
|
||||
}
|
||||
|
||||
public Boolean isDispose() {
|
||||
return isDispose;
|
||||
}
|
||||
|
||||
public void setDispose(Boolean dispose) {
|
||||
isDispose = dispose;
|
||||
}
|
||||
|
||||
public Integer getEventJsonDataHashCode() {
|
||||
return eventJsonDataHashCode;
|
||||
}
|
||||
|
||||
public void setEventJsonDataHashCode(Integer eventJsonDataHashCode) {
|
||||
this.eventJsonDataHashCode = eventJsonDataHashCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public V2XHistoryScenarioData clone() {
|
||||
try {
|
||||
return (V2XHistoryScenarioData) super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.mogo.eagle.core.data.map.entity;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 可直播车机基本信息,再通过 /yycp-realtimeLocations/realTimeLocationServer/car/queryNearbyVehicleLiveByLocation/v1
|
||||
* 获取直播信息
|
||||
* @author donghongyu
|
||||
*/
|
||||
public class V2XLiveCarInfoEntity {
|
||||
private String sn;
|
||||
private double lon;
|
||||
private double lat;
|
||||
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
V2XLiveCarInfoEntity that = (V2XLiveCarInfoEntity) o;
|
||||
return Double.compare(that.lon, lon) == 0 &&
|
||||
Double.compare(that.lat, lat) == 0 &&
|
||||
Objects.equals(sn, that.sn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sn, lon, lat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "V2XLiveCarEntity{" +
|
||||
"sn='" + sn + '\'' +
|
||||
", lon=" + lon +
|
||||
", lat=" + lat +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
package com.mogo.eagle.core.data.v2x;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* @description
|
||||
* @since 2020/7/29
|
||||
*/
|
||||
public class DrawLineInfo {
|
||||
//报警类型
|
||||
private String type;
|
||||
|
||||
// 起点位置
|
||||
private MogoLatLng startLocation;
|
||||
|
||||
//结束点位置
|
||||
private MogoLatLng endLocation;
|
||||
|
||||
//绘制线的多个点位置
|
||||
private List<MogoLatLng> locations;
|
||||
|
||||
private double heading;
|
||||
|
||||
private float width;
|
||||
|
||||
private boolean hasStopLines;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public MogoLatLng getStartLocation() {
|
||||
return startLocation;
|
||||
}
|
||||
|
||||
public void setStartLocation(MogoLatLng startLocation) {
|
||||
this.startLocation = startLocation;
|
||||
}
|
||||
|
||||
public MogoLatLng getEndLocation() {
|
||||
return endLocation;
|
||||
}
|
||||
|
||||
public void setEndLocation(MogoLatLng endLocation) {
|
||||
this.endLocation = endLocation;
|
||||
}
|
||||
|
||||
public double getHeading() {
|
||||
return heading;
|
||||
}
|
||||
|
||||
public void setHeading(double heading) {
|
||||
this.heading = heading;
|
||||
}
|
||||
|
||||
public float getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(float width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public boolean isHasStopLines() {
|
||||
return hasStopLines;
|
||||
}
|
||||
|
||||
public void setHasStopLines(boolean hasStopLines) {
|
||||
this.hasStopLines = hasStopLines;
|
||||
}
|
||||
|
||||
public List<MogoLatLng> getLocations() {
|
||||
return locations;
|
||||
}
|
||||
|
||||
public void setLocations(List<MogoLatLng> locations) {
|
||||
this.locations = locations;
|
||||
}
|
||||
}
|
||||
@@ -1,280 +0,0 @@
|
||||
|
||||
package com.mogo.eagle.core.data.v2x;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerOnlineCar;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class V2XAlarmEventRes extends BaseData implements Serializable {
|
||||
@Expose
|
||||
private Result result;
|
||||
|
||||
public Result getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(Result result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public class Result {
|
||||
@Expose
|
||||
@SerializedName(value = "recommendInfo", alternate = {"alarmInfo"})
|
||||
private AlarmInfo alarmInfo;
|
||||
@Expose
|
||||
private ArrayList<MarkerOnlineCar> onlineCar;
|
||||
|
||||
public ArrayList<MarkerOnlineCar> getOnlineCar() {
|
||||
return onlineCar;
|
||||
}
|
||||
|
||||
public void setOnlineCar(ArrayList<MarkerOnlineCar> onlineCar) {
|
||||
this.onlineCar = onlineCar;
|
||||
}
|
||||
|
||||
public AlarmInfo getAlarmInfo() {
|
||||
return alarmInfo;
|
||||
}
|
||||
|
||||
public void setAlarmInfo(AlarmInfo alarmInfo) {
|
||||
this.alarmInfo = alarmInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Result{" +
|
||||
"alarmInfo=" + alarmInfo +
|
||||
", onlineCar=" + onlineCar +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class AlarmInfo {
|
||||
|
||||
@Expose
|
||||
private ContentData contentData;
|
||||
@Expose
|
||||
private Double distance;
|
||||
@Expose
|
||||
private MarkerLocation location;
|
||||
@Expose
|
||||
private String poiType;
|
||||
@Expose
|
||||
private String tts;
|
||||
@Expose
|
||||
private String type;
|
||||
@Expose
|
||||
private String alarmContent;
|
||||
@Expose
|
||||
private int expireTime;
|
||||
@Expose
|
||||
private int parkingSpaceSurplusNum;
|
||||
|
||||
public ContentData getContentData() {
|
||||
return contentData;
|
||||
}
|
||||
|
||||
public void setContentData(ContentData contentData) {
|
||||
this.contentData = contentData;
|
||||
}
|
||||
|
||||
public Double getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance(Double distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public MarkerLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MarkerLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getPoiType() {
|
||||
if (TextUtils.isEmpty(poiType)) {
|
||||
return "";
|
||||
}
|
||||
return poiType;
|
||||
}
|
||||
|
||||
public void setPoiType(String poiType) {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public String getTts() {
|
||||
if (TextUtils.isEmpty(tts)) {
|
||||
return "";
|
||||
}
|
||||
return tts;
|
||||
}
|
||||
|
||||
public void setTts(String tts) {
|
||||
this.tts = tts;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getAlarmContent() {
|
||||
return alarmContent;
|
||||
}
|
||||
|
||||
public void setAlarmContent(String alarmContent) {
|
||||
this.alarmContent = alarmContent;
|
||||
}
|
||||
|
||||
public int getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
public void setExpireTime(int expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
public int getParkingSpaceSurplusNum() {
|
||||
return parkingSpaceSurplusNum;
|
||||
}
|
||||
|
||||
public void setParkingSpaceSurplusNum(int parkingSpaceSurplusNum) {
|
||||
this.parkingSpaceSurplusNum = parkingSpaceSurplusNum;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AlarmInfo{" +
|
||||
"contentData=" + contentData +
|
||||
", distance=" + distance +
|
||||
", location=" + location +
|
||||
", poiType='" + poiType + '\'' +
|
||||
", tts='" + tts + '\'' +
|
||||
", type='" + type + '\'' +
|
||||
", alarmContent='" + alarmContent + '\'' +
|
||||
", expireTime=" + expireTime +
|
||||
", parkingSpaceSurplusNum=" + parkingSpaceSurplusNum +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
public class ContentData {
|
||||
|
||||
@Expose
|
||||
private String iconUrl;
|
||||
@Expose
|
||||
private String imgUrl;
|
||||
@Expose
|
||||
private String infoId = ""; // POI 唯一标示 「纠错」或「确认」「点赞」使用
|
||||
@Expose
|
||||
private String title;
|
||||
@Expose
|
||||
private String content;
|
||||
@Expose
|
||||
private String gasPrices;//"[{\"gasCode\":\"95\",\"gasPrice\":10.0},{\"gasCode\":\"98\",\"gasPrice\":23.0}]"
|
||||
@Expose
|
||||
private String styleType;// 内容类型,image-图片类型,video-视频类型
|
||||
@Expose
|
||||
private String carSn;// 如果是用户上报的,则需要返回该字段
|
||||
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
public void setIconUrl(String iconUrl) {
|
||||
this.iconUrl = iconUrl;
|
||||
}
|
||||
|
||||
public String getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
public void setImgUrl(String imgUrl) {
|
||||
this.imgUrl = imgUrl;
|
||||
}
|
||||
|
||||
public String getInfoId() {
|
||||
return infoId;
|
||||
}
|
||||
|
||||
public void setInfoId(String infoId) {
|
||||
this.infoId = infoId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getGasPrices() {
|
||||
return gasPrices;
|
||||
}
|
||||
|
||||
public void setGasPrices(String gasPrices) {
|
||||
this.gasPrices = gasPrices;
|
||||
}
|
||||
|
||||
public String getStyleType() {
|
||||
return styleType;
|
||||
}
|
||||
|
||||
public void setStyleType(String styleType) {
|
||||
this.styleType = styleType;
|
||||
}
|
||||
|
||||
public String getCarSn() {
|
||||
return carSn;
|
||||
}
|
||||
|
||||
public void setCarSn(String carSn) {
|
||||
this.carSn = carSn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ContentData{" +
|
||||
"iconUrl='" + iconUrl + '\'' +
|
||||
", imgUrl='" + imgUrl + '\'' +
|
||||
", infoId='" + infoId + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", content='" + content + '\'' +
|
||||
", gasPrices='" + gasPrices + '\'' +
|
||||
", styleType='" + styleType + '\'' +
|
||||
", carSn='" + carSn + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "V2XAlarmEventMessage{" +
|
||||
"result=" + result +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ class V2XMarkerCardResult: V2XBaseData(), Serializable {
|
||||
var messageTime: Long = 0
|
||||
|
||||
override fun toString(): String {
|
||||
return "MarkerCardResult(dataType=$dataType, carChat=$carChat, shareMusic=$shareMusic, noveltyInfo=$noveltyInfo, onlineCar=$onlineCar, exploreWay=$exploreWay, messageTime=$messageTime)"
|
||||
return "V2XMarkerCardResult(dataType=$dataType, carChat=$carChat, shareMusic=$shareMusic, noveltyInfo=$noveltyInfo, onlineCar=$onlineCar, exploreWay=$exploreWay, messageTime=$messageTime)"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.api.map
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider
|
||||
import com.mogo.map.MogoMap.Companion.DEFAULT
|
||||
import com.mogo.map.location.IMogoGDLocationClient
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController
|
||||
@@ -13,7 +12,7 @@ interface IMogoMapService :IProvider {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
fun getMapUIController(mapTag:String): IMogoMapUIController
|
||||
fun getMapUIController(mapTag:String): IMogoMapUIController?
|
||||
|
||||
/**
|
||||
* 覆盖物操作
|
||||
|
||||
@@ -16,7 +16,6 @@ object CallerAutopilotPointCloudListenerManager : CallerBase<IMoGoAutopilotPoint
|
||||
@Synchronized
|
||||
fun invokeAutopilotPointCloudDataUpdate(pointCloud: ByteArray?) {
|
||||
M_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onAutopilotPointCloudDataUpdate(pointCloud)
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ object CallerMapUIServiceManager {
|
||||
)
|
||||
}
|
||||
|
||||
//todo 多实例
|
||||
//根据需要,以业务回调的方式对地图进行修改,或直接调用 DEFAULT 地图。
|
||||
fun getMapUIController(mapTag:String = DEFAULT): IMogoMapUIController? {
|
||||
return serviceProvider?.getMapUIController(mapTag)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.mogo.eagle.core.function.api.map.angle.*
|
||||
|
||||
|
||||
/**
|
||||
* 高精地图视角管理类
|
||||
* 高精地图视角管理类,根据业务需要,以业务回调/直接调用地图 ,对地图进行改变
|
||||
*/
|
||||
object CallerVisualAngleManager {
|
||||
|
||||
@@ -21,8 +21,6 @@ object CallerVisualAngleManager {
|
||||
}
|
||||
}
|
||||
|
||||
//todo 多实例
|
||||
|
||||
fun changeAngle(scene: Scene) {
|
||||
provider?.changeAngle(scene)
|
||||
}
|
||||
|
||||
1
libraries/mapmodule/.gitignore
vendored
Normal file
1
libraries/mapmodule/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
||||
@@ -1133,7 +1133,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
|
||||
//可以缩放
|
||||
private var isCanZoom = true
|
||||
|
||||
private var isVr = false
|
||||
private var isVr = true
|
||||
|
||||
override fun isTouching(): Boolean {
|
||||
return isTouchingFlag
|
||||
|
||||
@@ -34,7 +34,7 @@ interface IEventController {
|
||||
fun dispatchCameraChangeFinishListener(position: CameraPosition?)
|
||||
fun addMapTouchListener(mapTouchListener: OnMapTouchListener)
|
||||
fun removeMapTouchListener(mapTouchListener: OnMapTouchListener)
|
||||
fun dispatchMapTouchListener(event: MotionEvent?): Boolean
|
||||
fun dispatchMapTouchListener(event: MotionEvent): Boolean
|
||||
fun isMapTouchListenerListEmpty(): Boolean
|
||||
fun addMapClickListener(mapClickListener: OnMapClickListener)
|
||||
fun removeMapClickListener(mapClickListener: OnMapClickListener)
|
||||
|
||||
@@ -146,7 +146,7 @@ interface IMapController {
|
||||
): Boolean
|
||||
|
||||
fun updatePointCloudDataByPb(
|
||||
dataArray: ByteArray,
|
||||
dataArray: ByteArray?,
|
||||
isTrasformer: Boolean,
|
||||
isResidual: Boolean,
|
||||
isReset: Boolean
|
||||
|
||||
@@ -130,7 +130,7 @@ class MapEventController(): IEventController {
|
||||
}
|
||||
|
||||
|
||||
override fun dispatchMapTouchListener(event: MotionEvent?): Boolean{
|
||||
override fun dispatchMapTouchListener(event: MotionEvent): Boolean{
|
||||
mMapTouchListenerList?.let {
|
||||
for(listener in it){
|
||||
return listener.onTouch(event)
|
||||
|
||||
@@ -1855,7 +1855,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
|
||||
return mMapView.getMapEngine().updatePointCloudData(dataStr, isTrasformer, isResidual, isReset)
|
||||
}
|
||||
|
||||
override fun updatePointCloudDataByPb(dataArray: ByteArray, isTrasformer: Boolean, isResidual: Boolean, isReset: Boolean): Boolean {
|
||||
override fun updatePointCloudDataByPb(dataArray: ByteArray?, isTrasformer: Boolean, isResidual: Boolean, isReset: Boolean): Boolean {
|
||||
return mMapView.getMapEngine().updatePointCloudDataByPb(dataArray, isTrasformer, isResidual, isReset)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@ package com.zhidaoauto.map.sdk.inner.utils
|
||||
|
||||
import android.util.Log
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
import com.zhidaoauto.map.sdk.inner.CompileConfig
|
||||
import com.zhidaoauto.map.sdk.inner.CompileConfig.DEBUG
|
||||
import java.lang.Math.round
|
||||
import java.math.BigDecimal
|
||||
import java.text.DateFormat
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Calendar
|
||||
import java.util.TimeZone
|
||||
import kotlin.math.absoluteValue
|
||||
import kotlin.math.*
|
||||
|
||||
object MathUtils {
|
||||
|
||||
@@ -20,20 +20,19 @@ object MathUtils {
|
||||
* 大地坐标系资料WGS-84 长半径a=6378137 短半径b=6356752.3142 扁率f=1/298.2572236
|
||||
*/
|
||||
/** 长半径a=6378137 */
|
||||
private val EARTH_R = 6378137
|
||||
private val a = 6378137.0;
|
||||
private const val EARTH_R = 6378137
|
||||
private const val a = 6378137.0
|
||||
/** 短半径b=6356752.3142 */
|
||||
private val b = 6356752.3142;
|
||||
private const val b = 6356752.3142
|
||||
/** 扁率f=1/298.2572236 */
|
||||
private val f = 1 / 298.2572236;
|
||||
private const val f = 1 / 298.2572236
|
||||
|
||||
private val jl_jd = 102834.74258026089786013677476285 // 每经度单位米;
|
||||
private val jl_wd = 111712.69150641055729984301412873 // 每纬度单位米;
|
||||
private const val jl_jd = 102834.74258026089786013677476285 // 每经度单位米
|
||||
private const val jl_wd = 111712.69150641055729984301412873 // 每纬度单位米
|
||||
|
||||
fun getRound(value: Double, scale: Int): Double {
|
||||
val bg = BigDecimal(value)
|
||||
val result: Double = bg.setScale(scale, BigDecimal.ROUND_HALF_UP).toDouble()
|
||||
return result
|
||||
return bg.setScale(scale, BigDecimal.ROUND_HALF_UP).toDouble()
|
||||
}
|
||||
|
||||
fun getRound(value: Double): Double {
|
||||
@@ -50,7 +49,7 @@ object MathUtils {
|
||||
val lastOfLast = list[list.size - 2]
|
||||
val last = list[list.size - 1]
|
||||
val includeAngle = getIncludeAngle(lastOfLast, last, current)
|
||||
if (CompileConfig.DEBUG) {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "getFitLonLatPoint:includeAngle:${includeAngle} ")
|
||||
}
|
||||
if (includeAngle >= 1.0) {
|
||||
@@ -60,10 +59,10 @@ object MathUtils {
|
||||
val dx = lastOfLast.longitude - last.longitude
|
||||
val dy = lastOfLast.latitude - last.latitude
|
||||
var u = dx * (current.longitude - lastOfLast.longitude) + dy * (current.latitude - lastOfLast.latitude)
|
||||
u /= Math.pow(dx, 2.0) + Math.pow(dy, 2.0)
|
||||
u /= dx.pow(2.0) + dy.pow(2.0)
|
||||
val targetX = lastOfLast.longitude + u * dx
|
||||
val targetY = lastOfLast.latitude + u * dy
|
||||
if (CompileConfig.DEBUG) {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "getFitLonLatPoint:origin:${current.longitude},${current.latitude}-->${targetX},${targetY} ")
|
||||
}
|
||||
current.longitude = targetX
|
||||
@@ -80,44 +79,39 @@ object MathUtils {
|
||||
val dx2 = two.longitude - zero.longitude
|
||||
val dy2 = two.latitude - zero.latitude
|
||||
val innerVector = dx1 * dx2 + dy1 * dy2
|
||||
var radins = Math.acos(innerVector / (Math.sqrt(Math.pow(dx1, 2.0) + Math.pow(dy1, 2.0)) * Math.sqrt(Math.pow(dx2, 2.0) + Math.pow(dy2, 2.0))))
|
||||
return Math.toDegrees(radins)
|
||||
val radians = acos(innerVector / (sqrt(dx1.pow(2.0) + dy1.pow(2.0)) * sqrt(dx2.pow(2.0) + dy2.pow(2.0))))
|
||||
return Math.toDegrees(radians)
|
||||
}
|
||||
|
||||
/**
|
||||
* UTM角度转换为经纬度对应的角度
|
||||
*/
|
||||
fun convertAngle(angle: Double, lon: Double, lat: Double): Double {
|
||||
var angleOrigin = 450 - angle
|
||||
var radianOrigin = Math.toRadians(angleOrigin.toDouble())
|
||||
var radianLat = Math.toRadians(lat)
|
||||
val radianDeal = Math.atan2(Math.tan(radianOrigin) * Math.cos(radianLat),1.0)
|
||||
var ruler = 270
|
||||
if (angle >= 0 && angle < 180) {
|
||||
ruler = 90
|
||||
val angleOrigin = 450 - angle
|
||||
val radianOrigin = Math.toRadians(angleOrigin)
|
||||
val radianLat = Math.toRadians(lat)
|
||||
val radianDeal = atan2(tan(radianOrigin) * cos(radianLat), 1.0)
|
||||
val ruler: Int = if (angle >= 0 && angle < 180) {
|
||||
90
|
||||
} else {
|
||||
ruler = 270
|
||||
270
|
||||
}
|
||||
val result = ruler - Math.toDegrees(radianDeal)
|
||||
return result
|
||||
return ruler - Math.toDegrees(radianDeal)
|
||||
}
|
||||
|
||||
/**
|
||||
* 角度转换为经纬度对应的角度
|
||||
*/
|
||||
fun convertFlatAngle(angle: Double, lon: Double, lat: Double): Double {
|
||||
var angleOrigin = angle
|
||||
var radianOrigin = Math.toRadians(angleOrigin.toDouble())
|
||||
var radianLat = Math.toRadians(lat)
|
||||
val radianDeal = Math.atan2(Math.tan(radianOrigin) * Math.cos(radianLat),1.0)
|
||||
var ruler = 270
|
||||
if (angle >= 0 && angle < 180) {
|
||||
ruler = 90
|
||||
val radianOrigin = Math.toRadians(angle)
|
||||
val radianLat = Math.toRadians(lat)
|
||||
val radianDeal = atan2(tan(radianOrigin) * cos(radianLat), 1.0)
|
||||
val ruler = if (angle >= 0 && angle < 180) {
|
||||
90
|
||||
} else {
|
||||
ruler = 270
|
||||
270
|
||||
}
|
||||
val result = ruler - Math.toDegrees(radianDeal)
|
||||
return result
|
||||
return ruler - Math.toDegrees(radianDeal)
|
||||
}
|
||||
|
||||
|
||||
@@ -164,15 +158,15 @@ object MathUtils {
|
||||
return distance(front.longitude,front.latitude,end.longitude,end.latitude)
|
||||
}
|
||||
|
||||
fun getDistance(lon1:Double ,lat1:Double ,lon2:Double ,lat2:Double):Double {
|
||||
var radLat1 = Math.toRadians(lat1);
|
||||
var radLat2 = Math.toRadians(lat2);
|
||||
var a = radLat1 - radLat2;
|
||||
var b = Math.toRadians(lon1) - Math.toRadians(lon2);
|
||||
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2.0) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2.0)));
|
||||
s = s * EARTH_R;
|
||||
s = Math.round(s * 10000) / 10000.0;
|
||||
return s;
|
||||
fun getDistance(lon1:Double ,lat1:Double ,lon2:Double ,lat2:Double):Double {
|
||||
val radLat1 = Math.toRadians(lat1)
|
||||
val radLat2 = Math.toRadians(lat2)
|
||||
val a = radLat1 - radLat2
|
||||
val b = Math.toRadians(lon1) - Math.toRadians(lon2)
|
||||
var s = 2 * asin(sqrt(sin(a / 2).pow(2.0) + cos(radLat1) * cos(radLat2) * sin(b / 2).pow(2.0)))
|
||||
s *= EARTH_R
|
||||
s = round(s * 10000) / 10000.0
|
||||
return s
|
||||
}
|
||||
|
||||
|
||||
@@ -181,10 +175,10 @@ object MathUtils {
|
||||
if (distance == 0f) {
|
||||
return null
|
||||
}
|
||||
val radian = Math.toRadians(angle.toDouble())
|
||||
val radianCoangle = Math.toRadians(90.0 - angle.toDouble())
|
||||
var nLon = lon + distance * Math.sin(radian)/100000.0
|
||||
var nLat = lat + distance * Math.sin(radianCoangle)/100000.0
|
||||
val radian = Math.toRadians(angle)
|
||||
val radianCoAngle = Math.toRadians(90.0 - angle)
|
||||
val nLon = lon + distance * sin(radian) /100000.0
|
||||
val nLat = lat + distance * sin(radianCoAngle) /100000.0
|
||||
return LonLatPoint(nLon, nLat, 0.0,angle)
|
||||
}
|
||||
|
||||
@@ -209,14 +203,13 @@ object MathUtils {
|
||||
* @param @return 参数
|
||||
* @return String 平移后的经纬度 返回类型
|
||||
*/
|
||||
fun right(lon: Double, lat: Double, dist: Double): String? {
|
||||
fun right(lon: Double, lat: Double, dist: Double): String {
|
||||
val d: Double = dist / a
|
||||
val cs = Math.cos(rad(lat))
|
||||
val cs = cos(rad(lat))
|
||||
val c = d / cs * 180.0 / Math.PI
|
||||
return (lon + c).toString() + "," + lat
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @Title: top
|
||||
@@ -227,7 +220,7 @@ object MathUtils {
|
||||
* @param @return 参数
|
||||
* @return String 平移后的经纬度 返回类型
|
||||
*/
|
||||
fun top(lon: Double, lat: Double, dist: Double): String? {
|
||||
fun top(lon: Double, lat: Double, dist: Double): String {
|
||||
val d: Double = dist / a
|
||||
val c = d / Math.PI * 180.0
|
||||
return lon.toString() + "," + (lat + c)
|
||||
@@ -239,32 +232,32 @@ object MathUtils {
|
||||
fun getAngle(pLine: ArrayList<LonLatPoint>): Float {
|
||||
var tempAngle = 0.0
|
||||
if (pLine.size == 1) {
|
||||
tempAngle = pLine.get(0).angle
|
||||
tempAngle = pLine[0].angle
|
||||
} else {
|
||||
var lonLatPoint = pLine.get(pLine.size - 1)
|
||||
var lastlonLatPoint: LonLatPoint? = null
|
||||
pLine?.let {
|
||||
val lonLatPoint = pLine[pLine.size - 1]
|
||||
var lastLonLatPoint: LonLatPoint?
|
||||
pLine.let {
|
||||
if (it.size < 5) {
|
||||
lastlonLatPoint = pLine.get(0);
|
||||
lastLonLatPoint = pLine[0]
|
||||
} else {
|
||||
lastlonLatPoint = pLine.get(3);
|
||||
var dis = distance(lonLatPoint.longitude, lonLatPoint.latitude, lastlonLatPoint!!.longitude, lastlonLatPoint!!.latitude)
|
||||
lastLonLatPoint = pLine[3]
|
||||
val dis = distance(lonLatPoint.longitude, lonLatPoint.latitude, lastLonLatPoint!!.longitude, lastLonLatPoint!!.latitude)
|
||||
|
||||
if (dis < 0.2) {
|
||||
lastlonLatPoint = pLine.get(0)
|
||||
lastLonLatPoint = if (dis < 0.2) {
|
||||
pLine[0]
|
||||
} else if (dis < 0.8) {
|
||||
lastlonLatPoint = pLine.get(1)
|
||||
pLine[1]
|
||||
} else if (dis < 1.2) {
|
||||
lastlonLatPoint = pLine.get(2)
|
||||
pLine[2]
|
||||
} else {
|
||||
lastlonLatPoint = pLine.get(3)
|
||||
pLine[3]
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lonLatPoint != null && lastlonLatPoint != null) {
|
||||
if (lonLatPoint != null && lastLonLatPoint != null) {
|
||||
tempAngle = GisGeomTool.getAngleToNorth(
|
||||
getRound(lonLatPoint.longitude) - getRound(lastlonLatPoint!!.longitude),
|
||||
getRound(lonLatPoint.latitude) - getRound(lastlonLatPoint!!.latitude)
|
||||
getRound(lonLatPoint.longitude) - getRound(lastLonLatPoint!!.longitude),
|
||||
getRound(lonLatPoint.latitude) - getRound(lastLonLatPoint!!.latitude)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -273,7 +266,7 @@ object MathUtils {
|
||||
}
|
||||
}
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "angleop--tempAngle: ${tempAngle}")
|
||||
Log.i(TAG, "angleop--tempAngle: $tempAngle")
|
||||
}
|
||||
return tempAngle.toFloat()
|
||||
|
||||
@@ -287,75 +280,68 @@ object MathUtils {
|
||||
var index = 0
|
||||
var diffValOrigin = 0.0f
|
||||
var diffValCal = 0.0f
|
||||
var lonLatPoint = pLine.get(pLine.size - 1)
|
||||
val lonLatPoint = pLine[pLine.size - 1]
|
||||
if (pLine.size == 1) {
|
||||
tempAngle = lonLatPoint.angle
|
||||
} else {
|
||||
var lastlonLatPoint: LonLatPoint? = null
|
||||
lastlonLatPoint = pLine.get(pLine.size - 2);
|
||||
var dis = distance(lonLatPoint.longitude, lonLatPoint.latitude, lastlonLatPoint!!.longitude, lastlonLatPoint!!.latitude)
|
||||
var lastLonLatPoint: LonLatPoint = pLine[pLine.size - 2]
|
||||
val dis = distance(lonLatPoint.longitude, lonLatPoint.latitude, lastLonLatPoint.longitude, lastLonLatPoint.latitude)
|
||||
|
||||
if (dis < 0.2) {
|
||||
index = 0
|
||||
index = if (dis < 0.2) {
|
||||
0
|
||||
} else if (dis < 0.8) {
|
||||
index = 1
|
||||
1
|
||||
} else if (dis < 1.2) {
|
||||
index = 2
|
||||
2
|
||||
} else {
|
||||
index = 3
|
||||
3
|
||||
}
|
||||
if (index >= pLine.size) {
|
||||
index = pLine.size-2
|
||||
}
|
||||
lastlonLatPoint = pLine.get(index)
|
||||
if (lonLatPoint != null && lastlonLatPoint != null) {
|
||||
tempAngle = GisGeomTool.getAngleToNorth(
|
||||
getRound(lonLatPoint.longitude) - getRound(lastlonLatPoint!!.longitude),
|
||||
getRound(lonLatPoint.latitude) - getRound(lastlonLatPoint!!.latitude)
|
||||
)
|
||||
}
|
||||
lastLonLatPoint = pLine[index]
|
||||
tempAngle = GisGeomTool.getAngleToNorth(
|
||||
getRound(lonLatPoint.longitude) - getRound(lastLonLatPoint.longitude),
|
||||
getRound(lonLatPoint.latitude) - getRound(lastLonLatPoint.latitude)
|
||||
)
|
||||
|
||||
if (tempAngle == -400.0) {
|
||||
if (angles != null && angles.size > 0){
|
||||
tempAngle = angles.get(angles.size - 1)
|
||||
tempAngle = if (angles != null && angles.size > 0){
|
||||
angles[angles.size - 1]
|
||||
}else {
|
||||
tempAngle = lonLatPoint.angle
|
||||
lonLatPoint.angle
|
||||
}
|
||||
}
|
||||
var midAngle = tempAngle
|
||||
}
|
||||
|
||||
return tempAngle.toFloat()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
fun getLocationAngle(pLine: ArrayList<LonLatPoint>): Float {
|
||||
var tempAngle = 0.0
|
||||
val MAX_DISTANCE = 6
|
||||
var index = 0
|
||||
var lonLatPoint = pLine.get(pLine.size - 1)
|
||||
val lonLatPoint = pLine[pLine.size - 1]
|
||||
if (pLine.size == 1) {
|
||||
tempAngle = lonLatPoint.angle
|
||||
} else {
|
||||
var lastlonLatPoint: LonLatPoint? = null
|
||||
var lastLonLatPoint: LonLatPoint? = null
|
||||
var dis = 0.0
|
||||
for (i in 1 .. pLine.size-1){
|
||||
lastlonLatPoint = pLine.get(pLine.size - 1 - i)
|
||||
lastlonLatPoint?.let{
|
||||
lastLonLatPoint = pLine[pLine.size - 1 - i]
|
||||
lastLonLatPoint.let{
|
||||
dis = distance(lonLatPoint.longitude, lonLatPoint.latitude, it.longitude, it.latitude)
|
||||
index = pLine.size - 1 - i
|
||||
Log.d(TAG, "angleooo--distance: ${dis}, index: ${index}")
|
||||
Log.d(TAG, "angleooo--distance: ${dis}, index: $index")
|
||||
}
|
||||
if(dis >= MAX_DISTANCE){
|
||||
break
|
||||
}
|
||||
}
|
||||
if (lonLatPoint != null && lastlonLatPoint != null) {
|
||||
if (lonLatPoint != null && lastLonLatPoint != null) {
|
||||
tempAngle = GisGeomTool.getAngleToNorth(
|
||||
lonLatPoint.longitude - lastlonLatPoint!!.longitude,
|
||||
lonLatPoint.latitude - lastlonLatPoint!!.latitude
|
||||
lonLatPoint.longitude - lastLonLatPoint.longitude,
|
||||
lonLatPoint.latitude - lastLonLatPoint.latitude
|
||||
)
|
||||
}
|
||||
|
||||
@@ -364,11 +350,11 @@ object MathUtils {
|
||||
}
|
||||
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "angleooo-lastlonLatPoint: ${lastlonLatPoint},distance:${dis},index:${index}, tempAngle:${tempAngle}")
|
||||
Log.d(TAG, "angleooo-lastlonLatPoint: ${lastLonLatPoint},distance:${dis},index:${index}, tempAngle:${tempAngle}")
|
||||
}
|
||||
if(DEBUG) {
|
||||
for (lonlat in pLine) {
|
||||
Log.d(TAG, "angleooo-lonlat: ${lonlat}")
|
||||
for (lonLat in pLine) {
|
||||
Log.d(TAG, "angleooo-lonlat: $lonLat")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,9 +365,9 @@ object MathUtils {
|
||||
fun utcToUnix(time: Long):Long{
|
||||
val calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"))
|
||||
calendar.timeInMillis = time
|
||||
val localFormater = DateFormat.getInstance();//当地时间格式
|
||||
localFormater.setTimeZone(TimeZone.getDefault());
|
||||
val localTime = localFormater.format(calendar.getTime());
|
||||
val localFormatter = DateFormat.getInstance()//当地时间格式
|
||||
localFormatter.timeZone = TimeZone.getDefault()
|
||||
val localTime = localFormatter.format(calendar.time)
|
||||
return SimpleDateFormat().parse(localTime).time
|
||||
}
|
||||
|
||||
@@ -389,7 +375,7 @@ object MathUtils {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "getSmoothPoints: 平滑原始数据:${line.size}")
|
||||
}
|
||||
var list: ArrayList<LonLatPoint> = ArrayList<LonLatPoint>()
|
||||
val list: ArrayList<LonLatPoint> = ArrayList()
|
||||
if(line.size < 11){
|
||||
return line
|
||||
}
|
||||
@@ -421,9 +407,9 @@ object MathUtils {
|
||||
for (j in numBefore until i){
|
||||
sumY += line[j].latitude
|
||||
}
|
||||
var num = numAfter - numBefore
|
||||
var x = sumX/num
|
||||
var y = sumY/num
|
||||
val num = numAfter - numBefore
|
||||
val x = sumX/num
|
||||
val y = sumY/num
|
||||
val lonlatPoint = LonLatPoint(x, y)
|
||||
list.add(lonlatPoint)
|
||||
}
|
||||
@@ -437,18 +423,18 @@ object MathUtils {
|
||||
if (DEBUG) {
|
||||
Log.i(TAG, "getPoints: 插值原始数据:${line.size}")
|
||||
}
|
||||
var lonLatPoints: ArrayList<LonLatPoint> = ArrayList<LonLatPoint>()
|
||||
if(line != null && line.size > 0) {
|
||||
val lonLatPoints: ArrayList<LonLatPoint> = ArrayList()
|
||||
if(line.size > 0) {
|
||||
var startLonLatPoint = line[0]
|
||||
for (i in 0 until line.size - 1) {
|
||||
var start = startLonLatPoint
|
||||
var end = line[i + 1]
|
||||
val start = startLonLatPoint
|
||||
val end = line[i + 1]
|
||||
if (i == 0) {
|
||||
lonLatPoints.add(start)
|
||||
}
|
||||
val x = end.latitude - start.latitude
|
||||
val y = end.longitude - start.longitude
|
||||
val dis = Math.sqrt(x * x + y * y).absoluteValue * 100000
|
||||
val dis = sqrt(x * x + y * y).absoluteValue * 100000
|
||||
val unit = dis / factor
|
||||
val num = unit.toInt()
|
||||
if(num <= 0){
|
||||
@@ -460,11 +446,11 @@ object MathUtils {
|
||||
for (i in 1..num) {
|
||||
val lon = start.longitude + numY * i
|
||||
val lat = start.latitude + numX * i
|
||||
val lonlatPoint = LonLatPoint(lon, lat)
|
||||
val lonLatPoint = LonLatPoint(lon, lat)
|
||||
if (i == num) {
|
||||
startLonLatPoint = lonlatPoint
|
||||
startLonLatPoint = lonLatPoint
|
||||
}
|
||||
lonLatPoints.add(lonlatPoint)
|
||||
lonLatPoints.add(lonLatPoint)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -478,14 +464,14 @@ object MathUtils {
|
||||
|
||||
|
||||
fun getTravelList(travel: String): ArrayList<LonLatPoint>{
|
||||
var list = ArrayList<LonLatPoint>()
|
||||
val list = ArrayList<LonLatPoint>()
|
||||
var mTravel = travel.trim()
|
||||
if(mTravel.isNotEmpty()){
|
||||
if(mTravel.endsWith(",")){
|
||||
mTravel = mTravel.trim(',')
|
||||
}
|
||||
|
||||
var array = mTravel.split(",")
|
||||
val array = mTravel.split(",")
|
||||
if(array != null && array.size >= 2 && array.size%2 == 0){
|
||||
for(i in 0..array.size-1 step 2){
|
||||
val lonLatPoint = LonLatPoint(array[i].toDouble(), array[i+1].toDouble())
|
||||
@@ -533,25 +519,25 @@ object MathUtils {
|
||||
*/
|
||||
fun destination(lng: Double, lat: Double, heading: Double, distance: Double): DoubleArray {
|
||||
//计算扇形的眯点坐标
|
||||
val heading = (heading + 360) % 360
|
||||
val bearing = (heading + 360) % 360
|
||||
val rad = Math.PI / 180
|
||||
val radInv = 180 / Math.PI
|
||||
var lonRad = lng * rad
|
||||
var latRad = lat * rad
|
||||
var rheading = heading * rad
|
||||
var sinLatRad = Math.sin(latRad)
|
||||
var cosLatRad = Math.cos(latRad)
|
||||
var cosDistR = Math.cos(distance / EARTH_R)
|
||||
var sinDistR = Math.sin(distance / EARTH_R)
|
||||
var lat2 = Math.asin(
|
||||
sinLatRad * cosDistR + cosLatRad * sinDistR * Math.cos(rheading)
|
||||
val lonRad = lng * rad
|
||||
val latRad = lat * rad
|
||||
val rHeading = bearing * rad
|
||||
val sinLatRad = sin(latRad)
|
||||
val cosLatRad = cos(latRad)
|
||||
val cosDistR = cos(distance / EARTH_R)
|
||||
val sinDistR = sin(distance / EARTH_R)
|
||||
var lat2 = asin(
|
||||
sinLatRad * cosDistR + cosLatRad * sinDistR * cos(rHeading)
|
||||
)
|
||||
var lon2 = lonRad +
|
||||
Math.atan2(
|
||||
Math.sin(rheading) * sinDistR * cosLatRad,
|
||||
cosDistR - sinLatRad * Math.sin(lat2)
|
||||
);
|
||||
lon2 = lon2 * radInv;
|
||||
atan2(
|
||||
sin(rHeading) * sinDistR * cosLatRad,
|
||||
cosDistR - sinLatRad * sin(lat2)
|
||||
)
|
||||
lon2 *= radInv
|
||||
lon2 = if (lon2 > 180) {
|
||||
lon2 - 360
|
||||
} else {
|
||||
@@ -561,7 +547,7 @@ object MathUtils {
|
||||
lon2
|
||||
}
|
||||
}
|
||||
lat2 = lat2 * radInv
|
||||
lat2 *= radInv
|
||||
return doubleArrayOf(lon2, lat2)
|
||||
}
|
||||
|
||||
@@ -668,20 +654,19 @@ object MathUtils {
|
||||
}
|
||||
|
||||
// 计算两个线段的夹角
|
||||
fun computeAngle(segment1: Pair<LonLatPoint, LonLatPoint>, segment2: Pair<LonLatPoint, LonLatPoint>): Double? {
|
||||
fun computeAngle(segment1: Pair<LonLatPoint, LonLatPoint>, segment2: Pair<LonLatPoint, LonLatPoint>): Double {
|
||||
// 计算线段1的方向向量
|
||||
val v1 = LonLatPoint(segment1.second.longitude - segment1.first.longitude, segment1.second.latitude - segment1.first.latitude)
|
||||
// 计算线段2的方向向量
|
||||
val v2 = LonLatPoint(segment2.second.longitude - segment2.first.longitude, segment2.second.latitude - segment2.first.latitude)
|
||||
// 计算向量夹角的余弦值
|
||||
val cosAngle = (v1.longitude * v2.longitude + v1.latitude * v2.latitude) / (Math.sqrt(v1.longitude * v1.longitude + v1.latitude * v1.latitude) * Math.sqrt(v2.longitude * v2.longitude + v2.latitude * v2.latitude))
|
||||
val cosAngle = (v1.longitude * v2.longitude + v1.latitude * v2.latitude) / (sqrt(v1.longitude * v1.longitude + v1.latitude * v1.latitude) * sqrt(v2.longitude * v2.longitude + v2.latitude * v2.latitude))
|
||||
// 返回角度值
|
||||
return Math.toDegrees(Math.acos(cosAngle))
|
||||
return Math.toDegrees(acos(cosAngle))
|
||||
}
|
||||
|
||||
|
||||
// 获取距离自车最近的点及其下标
|
||||
fun getNearestPoints(mLonlatPoint: LonLatPoint, pointList: MutableList<LonLatPoint>): MutableList<LonLatPoint>?{
|
||||
fun getNearestPoints(mLonLatPoint: LonLatPoint, pointList: MutableList<LonLatPoint>): MutableList<LonLatPoint>?{
|
||||
if (pointList.isEmpty()) {
|
||||
return null
|
||||
}
|
||||
@@ -689,7 +674,7 @@ object MathUtils {
|
||||
var nearestIndex = -1
|
||||
|
||||
for ((index, point) in pointList.withIndex()) {
|
||||
val distance = distance(mLonlatPoint, point)
|
||||
val distance = distance(mLonLatPoint, point)
|
||||
if (distance < minDistance) {
|
||||
minDistance = distance
|
||||
nearestIndex = index
|
||||
@@ -700,21 +685,18 @@ object MathUtils {
|
||||
}
|
||||
|
||||
fun isInRegion(lon: Double, lat: Double, list: List<List<Double>>?): Boolean {
|
||||
var iSum: Int
|
||||
val iCount: Int
|
||||
var iIndex: Int
|
||||
var dLon1 = 0.0
|
||||
var dLon2 = 0.0
|
||||
var dLat1 = 0.0
|
||||
var dLat2 = 0.0
|
||||
var dLon1:Double
|
||||
var dLon2:Double
|
||||
var dLat1:Double
|
||||
var dLat2:Double
|
||||
var dLon: Double
|
||||
list?: return false
|
||||
if (list.size < 3) {
|
||||
return false
|
||||
}
|
||||
iSum = 0
|
||||
iCount = list.size
|
||||
iIndex = 0
|
||||
var iSum = 0
|
||||
val iCount = list.size
|
||||
var iIndex = 0
|
||||
while (iIndex < iCount) {
|
||||
if (iIndex == iCount - 1) {
|
||||
dLon1 = list[iIndex][0]
|
||||
@@ -729,7 +711,7 @@ object MathUtils {
|
||||
}
|
||||
// 以下语句判断A点是否在边的两端点的水平平行线之间,在则可能有交点,开始判断交点是否在左射线上
|
||||
if (lat >= dLat1 && lat < dLat2 || lat >= dLat2 && lat < dLat1) {
|
||||
if (Math.abs(dLat1 - dLat2) > 0) {
|
||||
if (abs(dLat1 - dLat2) > 0) {
|
||||
//得到 A点向左射线与边的交点的x坐标:
|
||||
dLon = dLon1 - (dLon1 - dLon2) * (dLat1 - lat) / (dLat1 - dLat2)
|
||||
// 如果交点在A点左侧(说明是做射线与 边的交点),则射线与边的全部交点数加一:
|
||||
|
||||
@@ -3,5 +3,5 @@ package com.zhidaoauto.map.sdk.open.abs
|
||||
import android.view.MotionEvent
|
||||
|
||||
interface OnMapTouchListener {
|
||||
fun onTouch(event: MotionEvent?):Boolean
|
||||
fun onTouch(event: MotionEvent):Boolean
|
||||
}
|
||||
@@ -27,7 +27,7 @@ object PointCloudHelper {
|
||||
* @param isReset 是否重置数据
|
||||
* @return 是否执行
|
||||
*/
|
||||
fun updatePointCloudDataByPb(dataArray: ByteArray, isTrasformer: Boolean, isResidual: Boolean, isReset: Boolean,mapController: IMapController?):Boolean{
|
||||
fun updatePointCloudDataByPb(dataArray: ByteArray?, isTrasformer: Boolean, isResidual: Boolean, isReset: Boolean,mapController: IMapController?):Boolean{
|
||||
return mapController?.updatePointCloudDataByPb(dataArray,isTrasformer,isResidual,isReset)?:false
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class MapStyleParams: IMapStyleParams {
|
||||
private var mLocationIcon3DRes = R.raw.car
|
||||
|
||||
//显示高精地图元素
|
||||
private var hdVisibileArray = intArrayOf(
|
||||
private var hdVisibleArray = intArrayOf(
|
||||
HDTypes.DIVIDER.type,
|
||||
HDTypes.ROAD_AREA.type,
|
||||
HDTypes.STOP_LINE.type,
|
||||
@@ -170,7 +170,7 @@ class MapStyleParams: IMapStyleParams {
|
||||
|
||||
|
||||
override fun getHDVisibileArray(): IntArray {
|
||||
return hdVisibileArray
|
||||
return hdVisibleArray
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +178,7 @@ class MapStyleParams: IMapStyleParams {
|
||||
* @param filter 参照 HDTypes
|
||||
*/
|
||||
override fun setHDVisibileArray(filter: IntArray): MapStyleParams {
|
||||
this.hdVisibileArray = filter
|
||||
this.hdVisibleArray = filter
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ class MapStyleParams: IMapStyleParams {
|
||||
|
||||
|
||||
override fun toString(): String {
|
||||
return "MapStyleParams( zoom=$zoom, carPosition=$carPosition, isAutoSwitch=$isAutoSwitch, isAutoLocation=$isAutoLocation, hdVisibileArray=${hdVisibileArray.contentToString()}, styleMode=$styleMode, perspectiveMode=$perspectiveMode, vrPerspectiveMode=$vrPerspectiveMode, vrAngleMode=$vrAngleMode, isSwitchViewAngle=$isSwitchViewAngle, vrEyeHeight=$vrEyeHeight, zoomVal=$zoomVal, minDistanceForPosition=$minDistanceForPosition, isShadowEnable=$isShadowEnable, styleName='$styleName')"
|
||||
return "MapStyleParams( zoom=$zoom, carPosition=$carPosition, isAutoSwitch=$isAutoSwitch, isAutoLocation=$isAutoLocation, hdVisibileArray=${hdVisibleArray.contentToString()}, styleMode=$styleMode, perspectiveMode=$perspectiveMode, vrPerspectiveMode=$vrPerspectiveMode, vrAngleMode=$vrAngleMode, isSwitchViewAngle=$isSwitchViewAngle, vrEyeHeight=$vrEyeHeight, zoomVal=$zoomVal, minDistanceForPosition=$minDistanceForPosition, isShadowEnable=$isShadowEnable, styleName='$styleName')"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import com.mogo.map.center.CenterLine;
|
||||
import com.mogo.map.overlay.line.Polyline;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay;
|
||||
import com.mogo.map.overlay.proxy.point.IMapPointOverlay;
|
||||
import com.mogo.map.road.RoadNameInfo;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import java.util.HashMap;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo.yycp.api.proto.SocketDownData;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-18
|
||||
* <p>
|
||||
* 地图控制接口
|
||||
*/
|
||||
public interface IMogoMap {
|
||||
|
||||
/**
|
||||
* 获取地图ui控制器,可以控制内置ui(缩放按钮、指北针等)是否显示及部分手势(滑动、双指缩放等)是否可用。
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoUiSettings getUiSettings();
|
||||
|
||||
/**
|
||||
* 操作地图视图
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IMogoMapUIController getUIController();
|
||||
|
||||
IMapPointOverlay addPoint(Point.Options options);
|
||||
|
||||
IMapPolylineOverlay addLine(Polyline.Options options);
|
||||
|
||||
/**
|
||||
* 批量更新锚点位置
|
||||
*
|
||||
* @param optionsArrayList 锚点集合
|
||||
*/
|
||||
void updateBatchMarkerPosition(HashMap<String, MessagePad.TrackedObject> optionsArrayList);
|
||||
|
||||
/**
|
||||
* 批量更新锚点位置
|
||||
*
|
||||
* @param optionsArrayList 锚点集合
|
||||
*/
|
||||
void updateBatchAiMarkerPosition(HashMap<String, SocketDownData.CloudRoadDataProto> optionsArrayList);
|
||||
|
||||
/**
|
||||
* 添加感知使用到的3d模型
|
||||
*
|
||||
* @param type
|
||||
* @param modelRes
|
||||
*/
|
||||
String addPreVehicleModel(int type, int modelRes);
|
||||
|
||||
/**
|
||||
* 要移除的感知数据uuid
|
||||
*
|
||||
* @param uuidString
|
||||
*/
|
||||
void removeMarker(String uuidString);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.mogo.map
|
||||
|
||||
import com.mogo.map.overlay.line.Polyline
|
||||
import com.mogo.map.overlay.point.Point
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController
|
||||
import com.mogo.map.overlay.proxy.point.IMapPointOverlay
|
||||
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
import java.util.HashMap
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-18
|
||||
*
|
||||
*
|
||||
* 地图控制接口
|
||||
*/
|
||||
interface IMogoMap {
|
||||
/**
|
||||
* 获取地图ui控制器,可以控制内置ui(缩放按钮、指北针等)是否显示及部分手势(滑动、双指缩放等)是否可用。
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
val uiSettings: IMogoUiSettings?
|
||||
|
||||
/**
|
||||
* 操作地图视图
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
val uiController: IMogoMapUIController?
|
||||
|
||||
fun addPoint(options: Point.Options?): IMapPointOverlay?
|
||||
|
||||
fun addLine(options: Polyline.Options?): IMapPolylineOverlay?
|
||||
|
||||
/**
|
||||
* 批量更新锚点位置
|
||||
*
|
||||
* @param optionsArrayList 锚点集合
|
||||
*/
|
||||
fun updateBatchMarkerPosition(optionsArrayList: HashMap<String?, TrackedObject?>?)
|
||||
|
||||
/**
|
||||
* 批量更新锚点位置
|
||||
*
|
||||
* @param optionsArrayList 锚点集合
|
||||
*/
|
||||
fun updateBatchAiMarkerPosition(optionsArrayList: HashMap<String?, SocketDownData.CloudRoadDataProto?>?)
|
||||
|
||||
/**
|
||||
* 添加感知使用到的3d模型
|
||||
*
|
||||
* @param type
|
||||
* @param modelRes
|
||||
*/
|
||||
fun addPreVehicleModel(type: Int, modelRes: Int): String?
|
||||
|
||||
/**
|
||||
* 要移除的感知数据uuid
|
||||
*
|
||||
* @param uuidString
|
||||
*/
|
||||
fun removeMarker(uuidString: String?)
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.mogo.map.center
|
||||
|
||||
import android.util.Pair
|
||||
|
||||
data class CenterLine(
|
||||
|
||||
var id: String = "", //id
|
||||
var tile_id: String = "", //瓦片id
|
||||
var road_id: String = "", //道路id
|
||||
var lane_id: String = "", //车道id
|
||||
var points: List<Pair<Double, Double>> = emptyList(),
|
||||
var angle: Double = 0.0
|
||||
)
|
||||
@@ -3,7 +3,6 @@ package com.mogo.map.listener;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.model.MogoPoi;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
|
||||
@@ -29,14 +28,6 @@ public interface IMogoMapListener {
|
||||
default void onTouch(MotionEvent motionEvent) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图上的任意poi点击
|
||||
*
|
||||
* @param poi
|
||||
*/
|
||||
default void onPOIClick(MogoPoi poi) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图点击
|
||||
*
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.map.listener
|
||||
|
||||
import android.view.MotionEvent
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.map.model.MogoPoi
|
||||
import com.mogo.map.uicontroller.EnumMapUI
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
@@ -48,13 +47,6 @@ class MogoMapListenerHandler private constructor() : IMogoMapListener, IMogoMapL
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPOIClick(poi: MogoPoi) {
|
||||
mMap.forEach {
|
||||
val listener = it.value
|
||||
listener.onPOIClick(poi)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMapClick(latLng: MogoLatLng) {
|
||||
mMap.forEach {
|
||||
val listener = it.value
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
package com.mogo.map.model;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
* <p>
|
||||
* 地图上的poi
|
||||
*/
|
||||
public class MogoPoi implements Parcelable {
|
||||
|
||||
private String name;
|
||||
private MogoLatLng coordinate;
|
||||
private String poiId;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName( String name ) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public MogoLatLng getCoordinate() {
|
||||
return coordinate;
|
||||
}
|
||||
|
||||
public void setCoordinate( MogoLatLng coordinate ) {
|
||||
this.coordinate = coordinate;
|
||||
}
|
||||
|
||||
public String getPoiId() {
|
||||
return poiId;
|
||||
}
|
||||
|
||||
public void setPoiId( String poiId ) {
|
||||
this.poiId = poiId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel( Parcel dest, int flags ) {
|
||||
dest.writeString( this.name );
|
||||
dest.writeParcelable( this.coordinate, flags );
|
||||
dest.writeString( this.poiId );
|
||||
}
|
||||
|
||||
public MogoPoi() {
|
||||
}
|
||||
|
||||
protected MogoPoi( Parcel in ) {
|
||||
this.name = in.readString();
|
||||
this.coordinate = in.readParcelable( MogoLatLng.class.getClassLoader() );
|
||||
this.poiId = in.readString();
|
||||
}
|
||||
|
||||
public static final Parcelable.Creator< MogoPoi > CREATOR = new Parcelable.Creator< MogoPoi >() {
|
||||
@Override
|
||||
public MogoPoi createFromParcel( Parcel source ) {
|
||||
return new MogoPoi( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoPoi[] newArray( int size ) {
|
||||
return new MogoPoi[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package com.mogo.map.road
|
||||
|
||||
data class RoadNameInfo(val tile_id: String? = "", val road_id: String? = "", val road_name: String? = "")
|
||||
@@ -1,127 +1,119 @@
|
||||
package com.mogo.map.uicontroller;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RawRes;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
|
||||
import java.util.List;
|
||||
package com.mogo.map.uicontroller
|
||||
|
||||
import android.graphics.Point
|
||||
import android.graphics.Rect
|
||||
import android.view.View
|
||||
import androidx.annotation.RawRes
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-26
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* 地图UI控制
|
||||
*/
|
||||
public interface IMogoMapUIController {
|
||||
|
||||
|
||||
interface IMogoMapUIController {
|
||||
/**
|
||||
* 修改缩放级别
|
||||
*/
|
||||
MapControlResult changeZoom(float zoom);
|
||||
|
||||
fun changeZoom(zoom: Float): MapControlResult
|
||||
|
||||
/**
|
||||
* 修改缩放级别的另一种方式
|
||||
* @param zoom 缩放比例
|
||||
*/
|
||||
void changeZoom2(float zoom);
|
||||
fun changeZoom2(zoom: Float)
|
||||
|
||||
/**
|
||||
* 进入VR 模式
|
||||
* 进入黑夜/白天 模式
|
||||
*
|
||||
* @param isDayMode true-白天模式,false-夜间模式
|
||||
*/
|
||||
void stepInVrMode(boolean isDayMode);
|
||||
fun stepInDayMode(isDayMode: Boolean)
|
||||
|
||||
/**
|
||||
* 切换3D模式下远距,中距,近距视角
|
||||
*
|
||||
* @param angelMode {@link VisualAngleMode}
|
||||
* @param angelMode [VisualAngleMode]
|
||||
*/
|
||||
void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng);
|
||||
fun changeMapVisualAngle(angelMode: VisualAngleMode, mogoLatLng: MogoLatLng?)
|
||||
|
||||
/**
|
||||
* 设置漫游路径
|
||||
* @param trajectory
|
||||
*/
|
||||
void setRoamTrajectory(String trajectory);
|
||||
fun setRoamTrajectory(trajectory: String)
|
||||
|
||||
/**
|
||||
* 设置漫游模式 , 0:自由漫游,1:路径漫游
|
||||
*/
|
||||
void setRomaMode(int mode);
|
||||
fun setRomaMode(mode: Int)
|
||||
|
||||
/**
|
||||
* 获得当前地图视距模式
|
||||
*
|
||||
* @return {@link VisualAngleMode}
|
||||
* @return [VisualAngleMode]
|
||||
*/
|
||||
VisualAngleMode getCurrentMapVisualAngle();
|
||||
val currentMapVisualAngle: VisualAngleMode
|
||||
|
||||
/**
|
||||
* 将地图移动至当前位置
|
||||
*/
|
||||
default void moveToCenter(MogoLatLng latLng) {
|
||||
moveToCenter(latLng, false);
|
||||
fun moveToCenter(latLng: MogoLatLng) {
|
||||
moveToCenter(latLng, false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 将地图移动至当前位置
|
||||
*/
|
||||
void moveToCenter(MogoLatLng latLng, boolean animate);
|
||||
fun moveToCenter(latLng: MogoLatLng, animate: Boolean)
|
||||
|
||||
/**
|
||||
* 是否白天模式
|
||||
* @return
|
||||
*/
|
||||
boolean isDayMode();
|
||||
val isDayMode: Boolean
|
||||
|
||||
/**
|
||||
* 显示我的位置
|
||||
*
|
||||
* @param visible true - 显示 false - 不显示
|
||||
*/
|
||||
void showMyLocation(boolean visible);
|
||||
fun showMyLocation(visible: Boolean)
|
||||
|
||||
/**
|
||||
* @param view
|
||||
*/
|
||||
void showMyLocation(View view);
|
||||
fun showMyLocation(view: View)
|
||||
|
||||
/**
|
||||
* 获取比例尺数据
|
||||
*
|
||||
* @return 当前缩放级别下,地图上1像素点对应的长度,单位米
|
||||
*/
|
||||
float getScalePerPixel();
|
||||
val scalePerPixel: Float
|
||||
|
||||
/**
|
||||
* 获取缩放比例
|
||||
*/
|
||||
float getZoomLevel();
|
||||
val zoomLevel: Float
|
||||
|
||||
/**
|
||||
* 获取视图东北角坐标
|
||||
*/
|
||||
MogoLatLng getCameraNorthEastPosition();
|
||||
val cameraNorthEastPosition: MogoLatLng?
|
||||
|
||||
/**
|
||||
* 获取视图西南角坐标
|
||||
*/
|
||||
MogoLatLng getCameraSouthWestPosition();
|
||||
val cameraSouthWestPosition: MogoLatLng?
|
||||
|
||||
/**
|
||||
* 获取视图中心点坐标
|
||||
*/
|
||||
MogoLatLng getWindowCenterLocation();
|
||||
val windowCenterLocation: MogoLatLng?
|
||||
|
||||
/**
|
||||
* 设置地图中心点
|
||||
@@ -129,22 +121,22 @@ public interface IMogoMapUIController {
|
||||
* @param mapCenterX x 点位置x值与地图宽度的比例
|
||||
* @param mapCenterY y 点位置x值与地图高度的比例
|
||||
*/
|
||||
void setPointToCenter(double mapCenterX, double mapCenterY);
|
||||
fun setPointToCenter(mapCenterX: Double, mapCenterY: Double)
|
||||
|
||||
/**
|
||||
* 获取经纬度对应的屏幕的位置
|
||||
*/
|
||||
Point getLocationPointInScreen(MogoLatLng latLng);
|
||||
fun getLocationPointInScreen(latLng: MogoLatLng): Point?
|
||||
|
||||
/**
|
||||
* 获取像素点对应的经纬度
|
||||
*/
|
||||
MogoLatLng getLocationMogoLatLngInScreen(Point point);
|
||||
fun getLocationMogoLatLngInScreen(point: Point): MogoLatLng?
|
||||
|
||||
/**
|
||||
* 设置刷新帧率
|
||||
*/
|
||||
void setRenderFps(int fps);
|
||||
fun setRenderFps(fps: Int)
|
||||
|
||||
/**
|
||||
* @param tag 调用业务
|
||||
@@ -153,12 +145,18 @@ public interface IMogoMapUIController {
|
||||
* @param bound 地图上可显示的范围
|
||||
* @param lockCarPosition 是否锁定车辆位置
|
||||
*/
|
||||
void showBounds(String tag, MogoLatLng carPosition, List<MogoLatLng> lonLats, Rect bound, boolean lockCarPosition);
|
||||
fun showBounds(
|
||||
tag: String,
|
||||
carPosition: MogoLatLng,
|
||||
lonLats: List<MogoLatLng>,
|
||||
bound: Rect,
|
||||
lockCarPosition: Boolean
|
||||
)
|
||||
|
||||
/**
|
||||
* 强制刷新地图
|
||||
*/
|
||||
void forceRender();
|
||||
fun forceRender()
|
||||
|
||||
/**
|
||||
* 计算两点之间的距离
|
||||
@@ -167,131 +165,117 @@ public interface IMogoMapUIController {
|
||||
* @param p2
|
||||
* @return
|
||||
*/
|
||||
float calculateLineDistance(MogoLatLng p1, MogoLatLng p2) throws Exception;
|
||||
fun calculateLineDistance(p1: MogoLatLng, p2: MogoLatLng): Float
|
||||
|
||||
/**
|
||||
* 锁车状态
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isCarLocked();
|
||||
val isCarLocked: Boolean
|
||||
|
||||
/**
|
||||
* 配置自车图标样式
|
||||
*
|
||||
* @param option 为空时使用
|
||||
* 默认配置
|
||||
* 默认配置
|
||||
*/
|
||||
void setCarCursorOption(@Nullable CarCursorOption option);
|
||||
fun setCarCursorOption(option: CarCursorOption)
|
||||
|
||||
/**
|
||||
* @param type :车尾灯类型 0=默认 1=左黄 2=右黄 3=双黄 4=双红
|
||||
* @param time: 闪烁时间 最小500ms 小于500ms 默认为500ms
|
||||
*/
|
||||
void setCarLightsType(int type, int time);
|
||||
fun setCarLightsType(type: Int, time: Int)
|
||||
|
||||
/**
|
||||
* 获取地图视图描述快照
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MapCameraPosition getMapCameraPosition();
|
||||
val mapCameraPosition: MapCameraPosition?
|
||||
|
||||
/**
|
||||
* 切换地图视图视角
|
||||
*
|
||||
* @param bearing
|
||||
*/
|
||||
void changeBearing(float bearing);
|
||||
fun changeBearing(bearing: Float)
|
||||
|
||||
/**
|
||||
* 修改高精地图自车图标
|
||||
* 传入资源ID
|
||||
*/
|
||||
void changeCurrentIcon(@RawRes int iconId);
|
||||
fun changeCurrentIcon(@RawRes iconId: Int)
|
||||
|
||||
/**
|
||||
* 自研地图是否匹配道路
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
default void rtkEnable(boolean enable) {
|
||||
|
||||
}
|
||||
|
||||
default void destroy() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车速资源缓存 id
|
||||
*
|
||||
* @param speedVal
|
||||
* @return
|
||||
*/
|
||||
default String getMarkerInfoResName(String speedVal) {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车速资源缓存 id
|
||||
*
|
||||
* @param speedVal
|
||||
* @return
|
||||
*/
|
||||
default void setMarkerInfoResName(String speedVal, String val) {
|
||||
|
||||
}
|
||||
fun rtkEnable(enable: Boolean) {}
|
||||
fun destroy() {}
|
||||
|
||||
/**
|
||||
* 设置地图视线角度
|
||||
*/
|
||||
void setMapDAngle(float angle);
|
||||
fun setMapDAngle(angle: Float)
|
||||
|
||||
/**
|
||||
* 设置锁屏模式
|
||||
*/
|
||||
void setLockMode(boolean isLock);
|
||||
fun setLockMode(isLock: Boolean)
|
||||
|
||||
/**
|
||||
* 设置手势滑动失效
|
||||
*/
|
||||
void setScrollGesturesEnable(boolean isEnable);
|
||||
fun setScrollGesturesEnable(isEnable: Boolean)
|
||||
|
||||
/**
|
||||
* 设置所有的滑动失效
|
||||
*/
|
||||
void setAllGesturesEnabled(boolean isEnable);
|
||||
fun setAllGesturesEnabled(isEnable: Boolean)
|
||||
|
||||
/**
|
||||
* 设置外界坐标系
|
||||
*
|
||||
* @param gnssInfo RTK 高精坐标,车辆惯导数据
|
||||
*/
|
||||
void setExtraGPSData(MogoLocation gnssInfo);
|
||||
fun setExtraGPSData(gnssInfo: MogoLocation)
|
||||
|
||||
/**
|
||||
* 打开点云绘制
|
||||
*
|
||||
* @param isDrawPointCloud 是否绘制点云
|
||||
*/
|
||||
void setIsDrawPointCloud(Boolean isDrawPointCloud);
|
||||
fun setIsDrawPointCloud(isDrawPointCloud: Boolean)
|
||||
|
||||
/**
|
||||
* 设制点云大小
|
||||
*
|
||||
* @param pointCloudSize 点云的点大小
|
||||
*/
|
||||
void setPointCloudSize(Float pointCloudSize);
|
||||
fun setPointCloudSize(pointCloudSize: Float)
|
||||
|
||||
/**
|
||||
* 设置点云颜色
|
||||
*
|
||||
* @param color // color:"#RRGGBB*
|
||||
*/
|
||||
void setPointCloudColor(String color);
|
||||
fun setPointCloudColor(color: String)
|
||||
|
||||
String getCityCode();
|
||||
/**
|
||||
* 更新点云数据
|
||||
* @param dataStr 点云数据
|
||||
* @param isTrasformer 是否需要转换坐标
|
||||
* @param isResidual 是否需要差量更新
|
||||
* @param isStrong 是否加粗显示
|
||||
* @return 是否执行
|
||||
*/
|
||||
fun updatePointCloud(
|
||||
dataArray: ByteArray?, isTrasformer: Boolean,
|
||||
isResidual: Boolean, isReset: Boolean
|
||||
): Boolean
|
||||
|
||||
/**
|
||||
* 自动切换视角到指定点,包含过渡动画,并持续指定duration毫秒
|
||||
@@ -302,8 +286,7 @@ public interface IMogoMapUIController {
|
||||
* @param duration 持续时间
|
||||
* @param isGps 是否是高精坐标
|
||||
*/
|
||||
void animateTo(double lon, double lat, float rotateAngle, int duration, boolean isGps);
|
||||
|
||||
fun animateTo(lon: Double, lat: Double, rotateAngle: Float, duration: Int, isGps: Boolean)
|
||||
|
||||
/**
|
||||
* 自动切换视角到指定点,包含过渡动画,并持续指定duration毫秒
|
||||
@@ -315,10 +298,13 @@ public interface IMogoMapUIController {
|
||||
* @param v3
|
||||
* @param v4
|
||||
*/
|
||||
void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps);
|
||||
fun animateTo(
|
||||
lon: Double, lat: Double, v1: Float, v2: Float,
|
||||
v3: Float, v4: Float, duration: Int, isGps: Boolean
|
||||
)
|
||||
|
||||
/**
|
||||
* 从地图上删除所有的overlay(marker,circle,polyline 等对象)。
|
||||
*/
|
||||
void clear();
|
||||
}
|
||||
fun clear()
|
||||
}
|
||||
@@ -65,7 +65,7 @@ dependencies {
|
||||
} else {
|
||||
implementation project(':libraries:mogo-map-api')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
implementation project(':core:mogo-core-function-call') //todo 解除依赖
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,960 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_HD_MAP_CALL;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_INIT_ON_MAP_INIT;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_INIT_ON_MAP_LOADED;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_ROMA_MODE_INVOKE;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_CODE_ROMA_REQUEST_OK;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_SOURCE_INIT;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_SOURCE_MAP;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_TYPE_HD_MAP;
|
||||
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_TYPE_INIT_STATUS;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAP;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ROMA;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_CLOSE_SIGHT;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MODE_MEDIUM_SIGHT;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||
import com.mogo.eagle.core.data.map.MapRoadInfo;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
|
||||
import com.mogo.map.identify.MogoIdentifyManager;
|
||||
import com.mogo.map.listener.MogoMapListenerHandler;
|
||||
import com.mogo.map.location.GDLocationClient;
|
||||
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.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.map.utils.MogoMapUtils;
|
||||
import com.mogo.map.utils.ObjectUtils;
|
||||
import com.mogo.map.utils.ResIdCache;
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint;
|
||||
import com.zhidaoauto.map.data.road.RoadCross;
|
||||
import com.zhidaoauto.map.data.road.StopLine;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnCameraChangeListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnMapClickListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnMapLoadedListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnMapStyleListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnMapTouchListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnMapViewVisualAngleChangeListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnRoadInfoListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.OnRoamStatusListener;
|
||||
import com.zhidaoauto.map.sdk.open.abs.log.ILog;
|
||||
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper;
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraPosition;
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraUpdateFactory;
|
||||
import com.zhidaoauto.map.sdk.open.camera.LatLngBounds;
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
|
||||
import com.zhidaoauto.map.sdk.open.location.LocationClient;
|
||||
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle;
|
||||
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker;
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnMarkClickListener;
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
|
||||
import com.zhjt.service.chain.ChainLog;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class AMapViewWrapper implements IMogoMapView, //代理地图实例和接口操作对象
|
||||
IMogoMapUIController,
|
||||
OnMapLoadedListener,
|
||||
OnCameraChangeListener,
|
||||
OnMapClickListener,
|
||||
OnMapTouchListener,
|
||||
OnMarkClickListener,
|
||||
OnMapStyleListener,
|
||||
OnMapViewVisualAngleChangeListener,
|
||||
OnRoadInfoListener,
|
||||
ILog, OnRoamStatusListener {
|
||||
|
||||
private static final String TAG = "AMapViewWrapper";
|
||||
private final MapAutoView mMapView;
|
||||
private final IMogoMap mIMap;
|
||||
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;
|
||||
private volatile EnumMapUI mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR;
|
||||
private VisualAngleMode mVisualAngleMode = MODE_MEDIUM_SIGHT;
|
||||
|
||||
public AMapViewWrapper(MapAutoView mMapView) {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "AMapViewWrapper: init");
|
||||
this.mMapView = mMapView;
|
||||
initViews();
|
||||
initListeners();
|
||||
this.mIMap = new AMapWrapper(this.mMapView.getMapAutoViewHelper(), this.mMapView, this);
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
// 初始化首次地图进入的时候的样式, MapAutoApi.INSTANCE.init(context, mapParams);将影响这里的数据
|
||||
int mapStyle = mMapView.getMapStyleParams().getStyleMode();
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "默认配置地图模式:mapStyle=" + mapStyle);
|
||||
switch (mapStyle) {
|
||||
case MapAutoApi.MAP_STYLE_DAY:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY;
|
||||
break;
|
||||
case MapAutoApi.MAP_STYLE_DAY_NAV:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_NAV;
|
||||
break;
|
||||
case MapAutoApi.MAP_STYLE_NIGHT:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT;
|
||||
break;
|
||||
case MapAutoApi.MAP_STYLE_NIGHT_NAV:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_NAV;
|
||||
break;
|
||||
case MapAutoApi.MAP_STYLE_DAY_VR:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
break;
|
||||
case MapAutoApi.MAP_STYLE_NIGHT_VR:
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR;
|
||||
break;
|
||||
default:
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "暂不支持此地图模式,默认使用VR夜间模式");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void initListeners() {
|
||||
mMapView.setOnMarkClickListener(this);
|
||||
mMapView.setOnMapLoadedListener(this);
|
||||
mMapView.setOnMapTouchListener(this);
|
||||
mMapView.setOnMapClickListener(this);
|
||||
mMapView.setOnCameraChangeListener(this);
|
||||
mMapView.setOnMapStyleListener(this);
|
||||
mMapView.setOnRoamStatusListener(this);
|
||||
mMapView.setOnMapViewVisualAngleChangeListener(this);
|
||||
mMapView.setOnRoadInfoListener(this, 1);
|
||||
MapAutoApi.INSTANCE.registerLogListener(this, mMapView.getEventController());
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "styleop - initListeners - setOnMapStyleListener - view " + mMapView);
|
||||
}
|
||||
|
||||
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);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onCreate");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
if (mMapView != null) {
|
||||
mMapView.onResume();
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onResume");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
if (mMapView != null) {
|
||||
mMapView.onPause();
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onPause");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
if (mMapView != null) {
|
||||
mMapView.onDestroy();
|
||||
mMapView.setOnMarkClickListener(null);
|
||||
mMapView.setOnMapLoadedListener(null);
|
||||
mMapView.setOnMapTouchListener(null);
|
||||
mMapView.setOnMapClickListener(null);
|
||||
mMapView.setOnCameraChangeListener(null);
|
||||
mMapView.setOnMapStyleListener(null);
|
||||
mMapView.setOnMapViewVisualAngleChangeListener(null);
|
||||
MapAutoApi.INSTANCE.unregisterLogListener(this, mMapView.getEventController());
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onDestroy");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
if (mMapView != null) {
|
||||
mMapView.onSaveInstanceState(outState);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onSaveInstanceState");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改获取当前车道号
|
||||
*
|
||||
* @param roadId
|
||||
* @param s1
|
||||
*/
|
||||
@Override
|
||||
public void onRoadIdInfo(@androidx.annotation.Nullable String roadId, @androidx.annotation.Nullable String s1) {
|
||||
if (roadId != null && !TextUtils.isEmpty(roadId)) {
|
||||
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnRoadIdGet(roadId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoadCrossInfo(@androidx.annotation.Nullable RoadCross roadCross) {
|
||||
|
||||
}
|
||||
|
||||
//todo 多实例 对象替换
|
||||
@Override
|
||||
public void onStopLineInfo(@androidx.annotation.Nullable StopLine stopLine) {
|
||||
MogoLocation carLoc = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84();
|
||||
if (stopLine != null && stopLine.getRoad_id() != null && !stopLine.getRoad_id().isEmpty() && stopLine.getPoints() != null && stopLine.getPoints().size() > 0) {
|
||||
ArrayList<LonLatPoint> points = stopLine.getPoints();
|
||||
if (carLoc != null) {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo:stop_line" + stopLine);
|
||||
MapRoadInfo.StopLine stopInfo = convert(stopLine);
|
||||
LonLatPoint p1 = points.get(0);
|
||||
LonLatPoint p2 = points.get(points.size() - 1);
|
||||
double distanceOfCarToStopLine = MapDataApi.INSTANCE.getNearstFromPointToSegment(carLoc.getLongitude(), carLoc.getLatitude(), p1.getLongitude(), p1.getLatitude(), p2.getLongitude(), p2.getLatitude()) * 10_0000;
|
||||
stopInfo.setDistanceOfCarToStopLine(distanceOfCarToStopLine);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo: --- distance: " + distanceOfCarToStopLine);
|
||||
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnStopLineGet(stopInfo);
|
||||
}
|
||||
} else {
|
||||
if (carLoc != null) {
|
||||
//CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo::null, car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private MapRoadInfo.StopLine convert(StopLine line) {
|
||||
MapRoadInfo.StopLine ret = new MapRoadInfo.StopLine();
|
||||
ret.setDistance(line.getDistance());
|
||||
ret.setLaneId(line.getLane_id());
|
||||
ret.setRoadId(line.getRoad_id());
|
||||
ret.setTieId(line.getTile_id());
|
||||
ArrayList<LonLatPoint> points = line.getPoints();
|
||||
if (points != null && points.size() > 0) {
|
||||
List<MogoLatLng> newPoints = new ArrayList<>();
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
LonLatPoint lonLatPoint = points.get(i);
|
||||
MogoLatLng latLng = new MogoLatLng(lonLatPoint.getLatitude(), lonLatPoint.getLongitude());
|
||||
latLng.duration = lonLatPoint.getDuration();
|
||||
latLng.angle = lonLatPoint.getAngle();
|
||||
latLng.speed = lonLatPoint.getSpeed();
|
||||
latLng.altitude = lonLatPoint.getAltitude();
|
||||
latLng.provider = lonLatPoint.getProvider();
|
||||
newPoints.add(latLng);
|
||||
}
|
||||
ret.setPoints(newPoints);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom(float zoom) {
|
||||
MapAutoViewHelper mapAutoViewHelper = mMapView.getMapAutoViewHelper();
|
||||
if (mapAutoViewHelper != null) {
|
||||
mapAutoViewHelper.setZoom((int) zoom);
|
||||
}
|
||||
return MapControlResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom2(float zoom) {
|
||||
MapAutoViewHelper mapAutoViewHelper = mMapView.getMapAutoViewHelper();
|
||||
if (mapAutoViewHelper != null) {
|
||||
mapAutoViewHelper.setZoomVal(zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
|
||||
MapAutoViewHelper mapAutoViewHelper = mMapView.getMapAutoViewHelper();
|
||||
if (mapAutoViewHelper != null) {
|
||||
mVisualAngleMode = angelMode;
|
||||
if (angelMode == MODE_CLOSE_SIGHT) {
|
||||
if (mogoLatLng == null) {
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "切换地图近景需要传入要移动的经纬度数据");
|
||||
return;
|
||||
}
|
||||
// 近景传入经纬度为点击地图上静态marker经纬度数据,为GPS坐标点。
|
||||
mapAutoViewHelper.setNearViewAnglePosition(new LonLatPoint(mogoLatLng.lon, mogoLatLng.lat), true);
|
||||
} else {
|
||||
mapAutoViewHelper.setMapViewVisualAngle(angelMode.getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_HD_MAP,
|
||||
linkCode = CHAIN_SOURCE_MAP,
|
||||
nodeAliasCode = CHAIN_CODE_HD_MAP_CALL,
|
||||
paramIndexes = {0}
|
||||
)
|
||||
@Override
|
||||
public void setRoamTrajectory(String trajectory) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setRoamTrajectory(trajectory);
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_HD_MAP,
|
||||
linkCode = CHAIN_SOURCE_MAP,
|
||||
parentNodeAliasCode = CHAIN_CODE_ROMA_REQUEST_OK,
|
||||
nodeAliasCode = CHAIN_CODE_ROMA_MODE_INVOKE,
|
||||
paramIndexes = {0},
|
||||
endPoint = false
|
||||
)
|
||||
@Override
|
||||
public void setRomaMode(int mode) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setRoamStyle(mode, 1800, MapAutoApi.ROAM_SPEED_40);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public VisualAngleMode getCurrentMapVisualAngle() {
|
||||
return mVisualAngleMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToCenter(MogoLatLng latLng) {
|
||||
moveToCenter(latLng, true);
|
||||
}
|
||||
|
||||
private boolean checkAMapView() {
|
||||
if (mMapView == null || mMapView.getMapAutoViewHelper() == null) {
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "自研mapView实例为空,请检查");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToCenter(MogoLatLng latLng, boolean animate) {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "move to center " + latLng);
|
||||
if (latLng == null || latLng.lat == 0.0d || latLng.lon == 0.0d) {
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "latLng = null or is illegal");
|
||||
return;
|
||||
}
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().animateCamera(new LonLatPoint(latLng.lon, latLng.lat));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation(boolean visible) {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "showMyLocation1 " + visible);
|
||||
// 如果是VR模式
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
// 不是VR模式情况强制刷新下
|
||||
if (checkAMapView()) {
|
||||
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
|
||||
if (visible) {
|
||||
// 强制刷新一遍车标
|
||||
style.myLocationIcon(mCarCursorOption.getCarCursorRes());
|
||||
}
|
||||
mMapView.getMapAutoViewHelper().setMyLocationStyle(style);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true-是,false=不是
|
||||
*/
|
||||
private boolean isVrMold() {
|
||||
boolean isVrMode = mCurrentUI == EnumMapUI.MAP_STYLE_NIGHT_VR || mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "是否是VR模式: " + isVrMode);
|
||||
return isVrMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是白天模式
|
||||
*
|
||||
* @return true-是,false-不是
|
||||
*/
|
||||
@Override
|
||||
public boolean isDayMode() {
|
||||
return mCurrentUI == EnumMapUI.MAP_STYLE_DAY_VR
|
||||
|| mCurrentUI == EnumMapUI.MAP_STYLE_DAY
|
||||
|| mCurrentUI == EnumMapUI.MAP_STYLE_DAY_NAV;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation(View view) {
|
||||
if (checkAMapView()) {
|
||||
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
|
||||
style.myLocationIcon(BitmapDescriptorFactory.INSTANCE.convertViewToBitmap(view));
|
||||
mMapView.getMapAutoViewHelper().setMyLocationStyle(style);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
if (checkAMapView()) {
|
||||
return mMapView.getMapAutoViewHelper().getScalePerPixel();
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getZoomLevel() {
|
||||
if (checkAMapView()) {
|
||||
return mMapView.getMapAutoViewHelper().getZoom();
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraNorthEastPosition() {
|
||||
return ObjectUtils.fromAMap(MapTools.INSTANCE.getVisibleRegion(mMapView.getMapController()).getRightTopPoint());
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraSouthWestPosition() {
|
||||
try {
|
||||
return ObjectUtils.fromAMap(MapTools.INSTANCE.getVisibleRegion(mMapView.getMapController()).getLeftBottomPoint());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getWindowCenterLocation() {
|
||||
try {
|
||||
if (checkAMapView()) {
|
||||
return ObjectUtils.fromAMap(mMapView.getMapAutoViewHelper().getCenter());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter(double mapCenterX, double mapCenterY) {
|
||||
if (checkAMapView()) {
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "setPointToCenter x : " + mapCenterX + " y : " + mapCenterY);
|
||||
mMapView.getMapAutoViewHelper().setPointToCenter((float) mapCenterX, (float) mapCenterY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getLocationPointInScreen(MogoLatLng latLng) {
|
||||
if (checkAMapView()) {
|
||||
try {
|
||||
return MapTools.INSTANCE.toScreenLocation(ObjectUtils.fromMogo(latLng), mMapView.getMapController());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getLocationMogoLatLngInScreen(Point point) {
|
||||
if (checkAMapView()) {
|
||||
try {
|
||||
return ObjectUtils.fromAMap(
|
||||
MapTools.INSTANCE.fromScreenLocation(point, mMapView.getMapController()));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRenderFps(int fps) {
|
||||
if (checkAMapView()) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
mMapView.getMapAutoViewHelper().setRenderFps(fps);
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "设置刷新帧率 fps = " + fps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showBounds(String tag, MogoLatLng carPosition, List<MogoLatLng> lonLats, Rect bound, boolean lockCarPosition) {
|
||||
if (!checkAMapView()) {
|
||||
return;
|
||||
}
|
||||
if (isVrMold()) {
|
||||
CallerLogger.INSTANCE.w(M_MAP + TAG, "vr 模式下忽略该设置");
|
||||
return;
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "showBounds : " + M_MAP + TAG + " , " + carPosition.toString() + " , " + bound.toShortString() + " , " + lockCarPosition);
|
||||
try {
|
||||
LatLngBounds latLngBounds = MogoMapUtils.getLatLngBounds(carPosition, lonLats, lockCarPosition);
|
||||
mMapView.getMapAutoViewHelper().setCenter(ObjectUtils.fromMogo(carPosition));
|
||||
mMapView.getMapAutoViewHelper().moveCamera(CameraUpdateFactory.INSTANCE.newLatLngBounds(latLngBounds, bound.left, bound.right, bound.top, bound.bottom));
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "M_MAP+TAG : " + M_MAP + TAG + " error : " + e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceRender() {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().runOnDrawFrame();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateLineDistance(MogoLatLng p1, MogoLatLng p2) throws Exception {
|
||||
if (p1 == null || p2 == null) {
|
||||
throw new Exception("计算距离的点不能为 null");
|
||||
}
|
||||
return MogoMapUtils.calculateLineDistance(ObjectUtils.fromMogo(p1), ObjectUtils.fromMogo(p2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean isCarLocked() {
|
||||
return mMapView.getMapAutoViewHelper().getLockMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCarCursorOption(CarCursorOption option) {
|
||||
if (isVrMold()) {
|
||||
return;
|
||||
}
|
||||
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 (!checkAMapView()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mMapView.getMapAutoViewHelper() == null) {
|
||||
return;
|
||||
}
|
||||
MyLocationStyle style = mMapView.getMapAutoViewHelper().getMyLocationStyle();
|
||||
if (mCarCursorOption.getCarCursorBmp() != null && !mCarCursorOption.getCarCursorBmp().isRecycled()) {
|
||||
style.myLocationIcon(mCarCursorOption.getCarCursorBmp());
|
||||
} else {
|
||||
if (mCarCursorOption.getCarCursorRes() != 0) {
|
||||
style.myLocationIcon(mCarCursorOption.getCarCursorRes());
|
||||
}
|
||||
}
|
||||
mMapView.getMapAutoViewHelper().setMyLocationStyle(style);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置转向灯和刹车灯
|
||||
*
|
||||
* @param type :车尾灯类型
|
||||
* @param time 闪烁时间 最小500ms 小于500ms 默认为500ms
|
||||
*/
|
||||
@Override
|
||||
public void setCarLightsType(int type, int time) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setTailLightsType(type, time);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapCameraPosition getMapCameraPosition() {
|
||||
if (checkAMapView()) {
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
return ObjectUtils.fromAMap(cameraPosition);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeBearing(float bearing) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setMapViewRotation(bearing);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeCurrentIcon(int iconId) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().getMyLocationStyle().myLocationIcon(iconId, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void result(@NonNull String filePath) {
|
||||
CallerMapDevaListenerManager.INSTANCE.invokeUploadLogFile(filePath);
|
||||
}
|
||||
|
||||
//渲染第一帧
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = CHAIN_SOURCE_INIT,
|
||||
nodeAliasCode = CHAIN_CODE_INIT_ON_MAP_INIT,
|
||||
paramIndexes = {-1}
|
||||
)
|
||||
@Override
|
||||
public void onMapInit() {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "onMapInit: ");
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapLoaded();
|
||||
}
|
||||
|
||||
//地图视图准备
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = CHAIN_SOURCE_INIT,
|
||||
nodeAliasCode = CHAIN_CODE_INIT_ON_MAP_LOADED,
|
||||
paramIndexes = {-1}
|
||||
)
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "onMapLoaded: ");
|
||||
if (checkAMapView()) {
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
cameraPosition.getZoom(),
|
||||
cameraPosition.getTilt(),
|
||||
cameraPosition.getBearing());
|
||||
loadPreVehicleModel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouch(@Nullable MotionEvent motionEvent) {
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onTouch(motionEvent);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick(@Nullable LonLatPoint lonLatPoint) {
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapClick(ObjectUtils.fromAMap(lonLatPoint));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapViewVisualAngleChange(int i) {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, " 地图自动更改视距 currentThread : " + Thread.currentThread().getName());
|
||||
mVisualAngleMode = getVisualAngleMode(i);
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapVisualAngleChanged(mVisualAngleMode);
|
||||
}
|
||||
|
||||
private VisualAngleMode getVisualAngleMode(int mode) {
|
||||
switch (mode) {
|
||||
case 0:
|
||||
return MODE_CLOSE_SIGHT;
|
||||
case 1:
|
||||
return MODE_MEDIUM_SIGHT;
|
||||
case 2:
|
||||
return MODE_LONG_SIGHT;
|
||||
case 3:
|
||||
return MAP_STYLE_VR_ANGLE_300;
|
||||
case 4:
|
||||
return MAP_STYLE_VR_ANGLE_TOP;
|
||||
case 5:
|
||||
return MAP_STYLE_VR_ANGLE_CROSS;
|
||||
case 7:
|
||||
return MAP_STYLE_VR_ROMA;
|
||||
default:
|
||||
return MODE_MEDIUM_SIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChange(int type, int value) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCameraChangeFinish(@Nullable CameraPosition cameraPosition) {
|
||||
if (cameraPosition != null) {
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapChanged(ObjectUtils.fromAMap(cameraPosition.getTarget()),
|
||||
cameraPosition.getZoom(),
|
||||
cameraPosition.getTilt(),
|
||||
cameraPosition.getBearing());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeMapStyle(int styleId) {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "currentMapStyle = " + styleId + " , current = " + mCurrentUI);
|
||||
// 映射地图样式ID到鹰眼样式ID
|
||||
if (styleId == MapAutoApi.MAP_STYLE_DAY
|
||||
|| styleId == MapAutoApi.MAP_STYLE_DAY_NAV) {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_NAV;
|
||||
} else if (styleId == MapAutoApi.MAP_STYLE_NIGHT) {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT;
|
||||
} else if (styleId == MapAutoApi.MAP_STYLE_NIGHT_NAV) {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_NAV;
|
||||
} else if (styleId == MapAutoApi.MAP_STYLE_NIGHT_VR) {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR;
|
||||
} else if (styleId == MapAutoApi.MAP_STYLE_DAY_VR) {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_VR;
|
||||
}
|
||||
|
||||
loadPreVehicleModel();
|
||||
|
||||
if (mCurrentUI != null) {
|
||||
UiThreadHandler.post(() -> {
|
||||
try {
|
||||
MogoMapListenerHandler.Companion.getMogoMapListenerHandler().onMapModeChanged(mCurrentUI);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMarkClick(@NotNull Marker markerInfo) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoamStatus(int status, @NonNull String msg) {
|
||||
CallerMapRomaListener.INSTANCE.invokeMapRomaStatus(status, msg);
|
||||
}
|
||||
|
||||
|
||||
// 是否使用RTK数据
|
||||
private boolean mRtkEnable = false;
|
||||
|
||||
@Override
|
||||
public void rtkEnable(boolean enable) {
|
||||
try {
|
||||
mRtkEnable = !mRtkEnable;
|
||||
if (mMapView != null && mMapView.getLocationClient() != null) {
|
||||
mMapView.getLocationClient().rtkEnable(mRtkEnable);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CallerLogger.INSTANCE.e(M_MAP + TAG, "rtkEnable has exception : " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
// try {
|
||||
// if (mMapView != null && mMapView.getMapAutoViewHelper() != null) {
|
||||
// mMapView.getMapAutoViewHelper().setMapStyle();
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMarkerInfoResName(String speedVal) {
|
||||
return ResIdCache.getVal(speedVal);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMarkerInfoResName(String speedVal, String val) {
|
||||
ResIdCache.putVal(speedVal, val);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(float angle) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setMapDAngle(angle);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载3D模型
|
||||
*/
|
||||
private void loadPreVehicleModel() {
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, "添加感知模型到地图中……");
|
||||
ThreadUtils.getIoPool().submit(() -> {
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI, "添加感知模型到地图中……preVehicleStrWeiZhi=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE, "添加感知模型到地图中……preVehicleStrPeople=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_BICYCLE, "添加感知模型到地图中……preVehicleStrBicycle=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE, "添加感知模型到地图中……preVehicleStrTaChe=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO, "添加感知模型到地图中……preVehicleStrMoto=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_BUS, "添加感知模型到地图中……preVehicleStrBus=");
|
||||
|
||||
addPreVehicleModelWeiZhi(TrafficTypeEnum.TYPE_TRAFFIC_ID_TRUCK, "添加感知模型到地图中……preVehicleStrTruck=");
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加模型到地图中
|
||||
*
|
||||
* @param typeTrafficId 障碍物类型ID
|
||||
* @param logMsg 日志消息
|
||||
*/
|
||||
private void addPreVehicleModelWeiZhi(TrafficTypeEnum typeTrafficId, String logMsg) {
|
||||
String preVehicleStrWeiZhi;
|
||||
// 根据当前的地图皮肤模式动态替换
|
||||
if (isDayMode()) {
|
||||
preVehicleStrWeiZhi =
|
||||
// 添加模型到地图中
|
||||
getMap().addPreVehicleModel(typeTrafficId.getType(), typeTrafficId.getTraffic3DIconId());
|
||||
} else {
|
||||
preVehicleStrWeiZhi =
|
||||
// 添加模型到地图中
|
||||
getMap().addPreVehicleModel(typeTrafficId.getType(), typeTrafficId.getTraffic3DNightIconId());
|
||||
}
|
||||
|
||||
CallerLogger.INSTANCE.d(M_MAP + TAG, logMsg + preVehicleStrWeiZhi);
|
||||
|
||||
if (preVehicleStrWeiZhi == null) {
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
CallerLogger.INSTANCE.w(M_MAP + TAG, "添加感知模型到地图中失败,尝试重复添加……");
|
||||
addPreVehicleModelWeiZhi(typeTrafficId, logMsg);
|
||||
}, 1000L);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockMode(boolean isLock) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setLockMode(isLock);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScrollGesturesEnable(boolean isEnable) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setScrollGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAllGesturesEnabled(boolean isEnable) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData(MogoLocation gnssInfo) {
|
||||
LocationClient locationClient = mMapView.getLocationClient();
|
||||
if (locationClient != null) {
|
||||
locationClient.setIsUseExtraGPSData(true);//设置是否使用外界坐标
|
||||
locationClient.rtkEnable(true);//设置是否是高精定位
|
||||
|
||||
LonLatPoint lonLatPoint = new LonLatPoint();
|
||||
lonLatPoint.setAngle(gnssInfo.getHeading());
|
||||
lonLatPoint.setAltitude(gnssInfo.getAltitude());
|
||||
lonLatPoint.setLongitude(gnssInfo.getLongitude());
|
||||
lonLatPoint.setLatitude(gnssInfo.getLatitude());
|
||||
lonLatPoint.setSatelliteTime(Double.valueOf(gnssInfo.getSatelliteTime() * 1000).longValue());
|
||||
lonLatPoint.setSpeed((float) gnssInfo.getGnssSpeed());
|
||||
|
||||
locationClient.updateLocation(lonLatPoint);//更新新自动驾驶RTK相关数据
|
||||
|
||||
CallerMapDataCollectorManager.INSTANCE.setIsInit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsDrawPointCloud(Boolean isDrawPointCloud) {
|
||||
try {
|
||||
// 是否绘制点云
|
||||
PointCloudHelper.INSTANCE.setIsDrawPointCloud(isDrawPointCloud, mMapView.getMapController());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointCloudSize(Float pointCloudSize) {
|
||||
//设置点云大小
|
||||
PointCloudHelper.INSTANCE.setPointCloudSize(pointCloudSize, mMapView.getMapController());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointCloudColor(String color) {
|
||||
// 设置点云颜色
|
||||
PointCloudHelper.INSTANCE.setPointCloudColor(color, mMapView.getMapController());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCityCode() {
|
||||
return GDLocationClient.Companion.getGdLocationClient().getLastCityCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float rotateAngle, int duration, boolean isGps) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().animateTo(lon, lat, rotateAngle, duration, isGps);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().animateTo(lon, lat, v1, v2, v3, v4, duration, isGps);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
if(checkAMapView()){
|
||||
mMapView.getMapAutoViewHelper().clearPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRoadLoaded(@androidx.annotation.Nullable String roadInfo) {
|
||||
|
||||
}
|
||||
}
|
||||
820
libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.kt
Normal file
820
libraries/mogo-map/src/main/java/com/mogo/map/AMapViewWrapper.kt
Normal file
@@ -0,0 +1,820 @@
|
||||
package com.mogo.map
|
||||
|
||||
import android.graphics.Point
|
||||
import android.graphics.Rect
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.data.map.MapRoadInfo
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager.setIsInit
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager.invokeUploadLogFile
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.invokeListenersOnRoadIdGet
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager.invokeListenersOnStopLineGet
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapRomaListener.invokeMapRomaStatus
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.listener.MogoMapListenerHandler.Companion.mogoMapListenerHandler
|
||||
import com.mogo.map.uicontroller.*
|
||||
import com.mogo.map.utils.MogoMapUtils
|
||||
import com.mogo.map.utils.ObjectUtils
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
import com.zhidaoauto.map.data.road.RoadCross
|
||||
import com.zhidaoauto.map.data.road.StopLine
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi.registerLogListener
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi.unregisterLogListener
|
||||
import com.zhidaoauto.map.sdk.open.abs.*
|
||||
import com.zhidaoauto.map.sdk.open.abs.log.ILog
|
||||
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper.setIsDrawPointCloud
|
||||
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper.setPointCloudColor
|
||||
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper.setPointCloudSize
|
||||
import com.zhidaoauto.map.sdk.open.business.PointCloudHelper.updatePointCloudDataByPb
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraPosition
|
||||
import com.zhidaoauto.map.sdk.open.camera.CameraUpdateFactory.newLatLngBounds
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi.getNearstFromPointToSegment
|
||||
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory.convertViewToBitmap
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnMarkClickListener
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools.fromScreenLocation
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools.getVisibleRegion
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools.toScreenLocation
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
|
||||
class AMapViewWrapper(mMapView: MapAutoView) : IMogoMapView, IMogoMapUIController,
|
||||
OnMapLoadedListener, OnCameraChangeListener, OnMapClickListener, OnMapTouchListener,
|
||||
OnMarkClickListener, OnMapStyleListener, OnMapViewVisualAngleChangeListener, OnRoadInfoListener,
|
||||
ILog, OnRoamStatusListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AMapViewWrapper"
|
||||
}
|
||||
|
||||
private var mMapView: MapAutoView
|
||||
private val mIMap: IMogoMap
|
||||
private val DEFAULT_OPTION = CarCursorOption.Builder()
|
||||
.carCursorRes(R.drawable.map_api_ic_current_location2)
|
||||
.naviCursorRes(R.drawable.ic_amap_navi_cursor)
|
||||
.build()
|
||||
private var mCarCursorOption = DEFAULT_OPTION
|
||||
|
||||
@Volatile
|
||||
private var mCurrentUI: EnumMapUI = EnumMapUI.MAP_STYLE_NIGHT_VR
|
||||
override var currentMapVisualAngle: VisualAngleMode = VisualAngleMode.MODE_MEDIUM_SIGHT
|
||||
private set
|
||||
|
||||
init {
|
||||
i(SceneConstant.M_MAP + TAG, "AMapViewWrapper: init")
|
||||
this.mMapView = mMapView
|
||||
initViews()
|
||||
initListeners()
|
||||
mIMap = AMapWrapper(this.mMapView.getMapAutoViewHelper(), this.mMapView, this)
|
||||
}
|
||||
|
||||
private fun initViews() {
|
||||
// 初始化首次地图进入的时候的样式, MapAutoApi.INSTANCE.init(context, mapParams);将影响这里的数据
|
||||
val mapStyle = mMapView.getMapStyleParams()!!.getStyleMode()
|
||||
d(SceneConstant.M_MAP + TAG, "默认配置地图模式:mapStyle=$mapStyle")
|
||||
when (mapStyle) {
|
||||
MapAutoApi.MAP_STYLE_DAY -> mCurrentUI = EnumMapUI.MAP_STYLE_DAY
|
||||
MapAutoApi.MAP_STYLE_DAY_NAV -> mCurrentUI = EnumMapUI.MAP_STYLE_DAY_NAV
|
||||
MapAutoApi.MAP_STYLE_NIGHT -> mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT
|
||||
MapAutoApi.MAP_STYLE_NIGHT_NAV -> mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_NAV
|
||||
MapAutoApi.MAP_STYLE_DAY_VR -> mCurrentUI = EnumMapUI.MAP_STYLE_DAY_VR
|
||||
MapAutoApi.MAP_STYLE_NIGHT_VR -> mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR
|
||||
else -> e(SceneConstant.M_MAP + TAG, "暂不支持此地图模式,默认使用VR夜间模式")
|
||||
}
|
||||
}
|
||||
|
||||
private fun initListeners() {
|
||||
mMapView.setOnMarkClickListener(this)
|
||||
mMapView.setOnMapLoadedListener(this)
|
||||
mMapView.setOnMapTouchListener(this)
|
||||
mMapView.setOnMapClickListener(this)
|
||||
mMapView.setOnCameraChangeListener(this)
|
||||
mMapView.setOnMapStyleListener(this)
|
||||
mMapView.setOnRoamStatusListener(this)
|
||||
mMapView.setOnMapViewVisualAngleChangeListener(this)
|
||||
mMapView.setOnRoadInfoListener(this, 1)
|
||||
registerLogListener(this, mMapView.getEventController())
|
||||
d(SceneConstant.M_MAP + TAG, "initListeners - setOnMapStyleListener - view $mMapView")
|
||||
}
|
||||
|
||||
override fun getMapView(): View {
|
||||
return mMapView
|
||||
}
|
||||
|
||||
override fun getMap(): IMogoMap {
|
||||
return mIMap
|
||||
}
|
||||
|
||||
override fun onCreate(bundle: Bundle?) {
|
||||
mMapView.onCreate(bundle)
|
||||
d(SceneConstant.M_MAP + TAG, "map onCreate")
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
mMapView.onResume()
|
||||
d(SceneConstant.M_MAP + TAG, "map onResume")
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
mMapView.onPause()
|
||||
d(SceneConstant.M_MAP + TAG, "map onPause")
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
mMapView.onDestroy()
|
||||
mMapView.setOnMarkClickListener(null)
|
||||
mMapView.setOnMapLoadedListener(null)
|
||||
mMapView.setOnMapTouchListener(null)
|
||||
mMapView.setOnMapClickListener(null)
|
||||
mMapView.setOnCameraChangeListener(null)
|
||||
mMapView.setOnMapStyleListener(null)
|
||||
mMapView.setOnMapViewVisualAngleChangeListener(null)
|
||||
unregisterLogListener(this, mMapView.getEventController())
|
||||
d(SceneConstant.M_MAP + TAG, "map onDestroy")
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
mMapView.onSaveInstanceState(outState)
|
||||
d(SceneConstant.M_MAP + TAG, "map onSaveInstanceState")
|
||||
}
|
||||
|
||||
override fun onLowMemory() {}
|
||||
|
||||
//渲染第一帧
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_INIT,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_INIT_ON_MAP_INIT,
|
||||
paramIndexes = [-1]
|
||||
)
|
||||
override fun onMapInit() {
|
||||
i(SceneConstant.M_MAP + TAG, "onMapInit: ")
|
||||
mogoMapListenerHandler.onMapLoaded()
|
||||
}
|
||||
|
||||
//地图视图准备
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_INIT_STATUS,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_INIT,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_INIT_ON_MAP_LOADED,
|
||||
paramIndexes = [-1]
|
||||
)
|
||||
override fun onMapLoaded() {
|
||||
i(SceneConstant.M_MAP + TAG, "onMapLoaded: ")
|
||||
if (checkAMapView()) {
|
||||
val cameraPosition = mMapView.getMapAutoViewHelper()!!
|
||||
.getCameraPosition()
|
||||
mogoMapListenerHandler.onMapChanged(
|
||||
ObjectUtils.fromAMap(cameraPosition.target),
|
||||
cameraPosition.zoom,
|
||||
cameraPosition.tilt,
|
||||
cameraPosition.bearing
|
||||
)
|
||||
loadPreVehicleModel()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改获取当前车道号
|
||||
*
|
||||
* @param roadId
|
||||
* @param laneId
|
||||
*/
|
||||
override fun onRoadIdInfo(roadId: String?, laneId: String?) {
|
||||
if (roadId != null && !TextUtils.isEmpty(roadId)) {
|
||||
invokeListenersOnRoadIdGet(roadId)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onRoadCrossInfo(roadCross: RoadCross?) {
|
||||
d(SceneConstant.M_MAP + TAG, "onRoadCrossInfo:roadCross$roadCross")
|
||||
}
|
||||
|
||||
//todo 多实例 对象替换
|
||||
override fun onStopLineInfo(stopLine: StopLine?) {
|
||||
val carLoc = getChassisLocationWGS84()
|
||||
if (stopLine != null && !stopLine.road_id.isEmpty() && stopLine.points.size > 0) {
|
||||
val points = stopLine.points
|
||||
d(SceneConstant.M_MAP + TAG, "onStopLineInfo:stop_line$stopLine")
|
||||
val stopInfo = convert(stopLine)
|
||||
val p1 = points[0]
|
||||
val p2 = points[points.size - 1]
|
||||
val distanceOfCarToStopLine = getNearstFromPointToSegment(
|
||||
carLoc.longitude,
|
||||
carLoc.latitude,
|
||||
p1.longitude,
|
||||
p1.latitude,
|
||||
p2.longitude,
|
||||
p2.latitude
|
||||
) * 100000
|
||||
stopInfo.distanceOfCarToStopLine = distanceOfCarToStopLine
|
||||
d(SceneConstant.M_MAP + TAG, "onStopLineInfo: --- distance: $distanceOfCarToStopLine")
|
||||
invokeListenersOnStopLineGet(stopInfo)
|
||||
}
|
||||
}
|
||||
|
||||
private fun convert(line: StopLine): MapRoadInfo.StopLine {
|
||||
val ret = MapRoadInfo.StopLine()
|
||||
ret.distance = line.distance
|
||||
ret.laneId = line.lane_id
|
||||
ret.roadId = line.road_id
|
||||
ret.tieId = line.tile_id
|
||||
val points = line.points
|
||||
if (points.size > 0) {
|
||||
val newPoints: MutableList<MogoLatLng> = ArrayList()
|
||||
for (i in points.indices) {
|
||||
val lonLatPoint = points[i]
|
||||
val latLng = MogoLatLng(lonLatPoint.latitude, lonLatPoint.longitude)
|
||||
latLng.duration = lonLatPoint.duration
|
||||
latLng.angle = lonLatPoint.angle
|
||||
latLng.speed = lonLatPoint.speed
|
||||
latLng.altitude = lonLatPoint.altitude
|
||||
latLng.provider = lonLatPoint.provider
|
||||
newPoints.add(latLng)
|
||||
}
|
||||
ret.points = newPoints
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
override fun changeZoom(zoom: Float): MapControlResult {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.setZoom(zoom.toInt())
|
||||
}
|
||||
return MapControlResult.SUCCESS
|
||||
}
|
||||
|
||||
override fun changeZoom2(zoom: Float) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.setZoomVal(zoom)
|
||||
}
|
||||
}
|
||||
|
||||
override fun changeMapVisualAngle(angelMode: VisualAngleMode, mogoLatLng: MogoLatLng?) {
|
||||
val mapAutoViewHelper = mMapView.getMapAutoViewHelper()
|
||||
if (mapAutoViewHelper != null) {
|
||||
currentMapVisualAngle = angelMode
|
||||
if (angelMode == VisualAngleMode.MODE_CLOSE_SIGHT) {
|
||||
if (mogoLatLng == null) {
|
||||
e(SceneConstant.M_MAP + TAG, "切换地图近景需要传入要移动的经纬度数据")
|
||||
return
|
||||
}
|
||||
// 近景传入经纬度为点击地图上静态marker经纬度数据,为GPS坐标点。
|
||||
mapAutoViewHelper.setNearViewAnglePosition(
|
||||
LonLatPoint(
|
||||
mogoLatLng.lon,
|
||||
mogoLatLng.lat
|
||||
), true
|
||||
)
|
||||
} else {
|
||||
mapAutoViewHelper.setMapViewVisualAngle(angelMode.code)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_HD_MAP,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_MAP,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_HD_MAP_CALL,
|
||||
paramIndexes = [0]
|
||||
)
|
||||
override fun setRoamTrajectory(trajectory: String) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.setRoamTrajectory(trajectory)
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_HD_MAP,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_MAP,
|
||||
parentNodeAliasCode = ChainConstant.CHAIN_CODE_ROMA_REQUEST_OK,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_ROMA_MODE_INVOKE,
|
||||
paramIndexes = [0],
|
||||
endPoint = false
|
||||
)
|
||||
override fun setRomaMode(mode: Int) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.setRoamStyle(mode, 1800f, MapAutoApi.ROAM_SPEED_40)
|
||||
}
|
||||
}
|
||||
|
||||
override fun moveToCenter(latLng: MogoLatLng) {
|
||||
moveToCenter(latLng, true)
|
||||
}
|
||||
|
||||
private fun checkAMapView(): Boolean {
|
||||
if (mMapView.getMapAutoViewHelper() == null) {
|
||||
e(SceneConstant.M_MAP + TAG, "自研mapView实例为空,请检查")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun moveToCenter(latLng: MogoLatLng, animate: Boolean) {
|
||||
d(SceneConstant.M_MAP + TAG, "move to center $latLng")
|
||||
if (latLng.lat == 0.0 || latLng.lon == 0.0) {
|
||||
e(SceneConstant.M_MAP + TAG, "latLng = null or is illegal")
|
||||
return
|
||||
}
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!
|
||||
.animateCamera(LonLatPoint(latLng.lon, latLng.lat))
|
||||
}
|
||||
}
|
||||
|
||||
override fun showMyLocation(visible: Boolean) {
|
||||
d(SceneConstant.M_MAP + TAG, "showMyLocation1 $visible")
|
||||
// 如果是VR模式
|
||||
if (isVrMold) {
|
||||
return
|
||||
}
|
||||
// 不是VR模式情况强制刷新下
|
||||
if (checkAMapView()) {
|
||||
val style = mMapView.getMapAutoViewHelper()!!
|
||||
.getMyLocationStyle()
|
||||
if (visible) {
|
||||
// 强制刷新一遍车标
|
||||
style!!.myLocationIcon(mCarCursorOption!!.carCursorRes)
|
||||
}
|
||||
mMapView.getMapAutoViewHelper()!!.setMyLocationStyle(style!!)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true-是,false=不是
|
||||
*/
|
||||
private val isVrMold: Boolean
|
||||
get() {
|
||||
val isVrMode =
|
||||
mCurrentUI === EnumMapUI.MAP_STYLE_NIGHT_VR || mCurrentUI === EnumMapUI.MAP_STYLE_DAY_VR
|
||||
d(SceneConstant.M_MAP + TAG, "是否是VR模式: $isVrMode")
|
||||
return isVrMode
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是白天模式
|
||||
*
|
||||
* @return true-是,false-不是
|
||||
*/
|
||||
override val isDayMode: Boolean
|
||||
get() = mCurrentUI === EnumMapUI.MAP_STYLE_DAY_VR || mCurrentUI === EnumMapUI.MAP_STYLE_DAY || mCurrentUI === EnumMapUI.MAP_STYLE_DAY_NAV
|
||||
|
||||
override fun showMyLocation(view: View) {
|
||||
if (checkAMapView()) {
|
||||
val style = mMapView.getMapAutoViewHelper()!!.getMyLocationStyle()
|
||||
style!!.myLocationIcon(convertViewToBitmap(view))
|
||||
mMapView.getMapAutoViewHelper()!!.setMyLocationStyle(style)
|
||||
}
|
||||
}
|
||||
|
||||
override val scalePerPixel: Float
|
||||
get() = if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.getScalePerPixel()
|
||||
} else 0.0f
|
||||
override val zoomLevel: Float
|
||||
get() = if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.getZoom().toFloat()
|
||||
} else 0.0f
|
||||
override val cameraNorthEastPosition: MogoLatLng?
|
||||
get() = ObjectUtils.fromAMap(getVisibleRegion(mMapView.getMapController()).rightTopPoint)
|
||||
override val cameraSouthWestPosition: MogoLatLng?
|
||||
get() {
|
||||
try {
|
||||
return ObjectUtils.fromAMap(getVisibleRegion(mMapView.getMapController()).leftBottomPoint)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return null
|
||||
}
|
||||
override val windowCenterLocation: MogoLatLng?
|
||||
get() {
|
||||
try {
|
||||
if (checkAMapView()) {
|
||||
return ObjectUtils.fromAMap(mMapView.getMapAutoViewHelper()!!.getCenter())
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
override fun setPointToCenter(mapCenterX: Double, mapCenterY: Double) {
|
||||
if (checkAMapView()) {
|
||||
if (isVrMold) {
|
||||
return
|
||||
}
|
||||
mMapView.getMapAutoViewHelper()!!
|
||||
.setPointToCenter(mapCenterX.toFloat(), mapCenterY.toFloat())
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLocationPointInScreen(latLng: MogoLatLng): Point? {
|
||||
return if (checkAMapView()) {
|
||||
try {
|
||||
toScreenLocation(ObjectUtils.fromMogo(latLng), mMapView.getMapController())
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
} else null
|
||||
}
|
||||
|
||||
override fun getLocationMogoLatLngInScreen(point: Point): MogoLatLng? {
|
||||
return if (checkAMapView()) {
|
||||
try {
|
||||
ObjectUtils.fromAMap(fromScreenLocation(point, mMapView.getMapController()))
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
null
|
||||
}
|
||||
} else null
|
||||
}
|
||||
|
||||
override fun setRenderFps(fps: Int) {
|
||||
if (checkAMapView()) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
mMapView.getMapAutoViewHelper()!!.setRenderFps(fps)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun showBounds(
|
||||
tag: String,
|
||||
carPosition: MogoLatLng,
|
||||
lonLats: List<MogoLatLng>,
|
||||
bound: Rect,
|
||||
lockCarPosition: Boolean
|
||||
) {
|
||||
if (!checkAMapView()) {
|
||||
return
|
||||
}
|
||||
if (isVrMold) {
|
||||
w(SceneConstant.M_MAP + TAG, "vr 模式下忽略该设置")
|
||||
return
|
||||
}
|
||||
i(
|
||||
SceneConstant.M_MAP + TAG,
|
||||
"showBounds : " + carPosition.toString() + " , " + bound.toShortString() + " , " + lockCarPosition
|
||||
)
|
||||
try {
|
||||
val latLngBounds = MogoMapUtils.getLatLngBounds(carPosition, lonLats, lockCarPosition)
|
||||
mMapView.getMapAutoViewHelper()!!.setCenter(ObjectUtils.fromMogo(carPosition))
|
||||
mMapView.getMapAutoViewHelper()!!.moveCamera(
|
||||
newLatLngBounds(
|
||||
latLngBounds,
|
||||
bound.left,
|
||||
bound.right,
|
||||
bound.top,
|
||||
bound.bottom
|
||||
)
|
||||
)
|
||||
} catch (e: Exception) {
|
||||
e(SceneConstant.M_MAP + TAG, " error : $e")
|
||||
}
|
||||
}
|
||||
|
||||
override fun forceRender() {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.runOnDrawFrame()
|
||||
}
|
||||
}
|
||||
|
||||
override fun calculateLineDistance(p1: MogoLatLng, p2: MogoLatLng): Float {
|
||||
return MogoMapUtils.calculateLineDistance(
|
||||
ObjectUtils.fromMogo(p1),
|
||||
ObjectUtils.fromMogo(p2)
|
||||
)
|
||||
}
|
||||
|
||||
@get:Synchronized
|
||||
override val isCarLocked: Boolean
|
||||
get() = mMapView.getMapAutoViewHelper()!!.getLockMode()
|
||||
|
||||
override fun setCarCursorOption(option: CarCursorOption) {
|
||||
if (isVrMold) {
|
||||
return
|
||||
}
|
||||
if (!checkAMapView()) {
|
||||
return
|
||||
}
|
||||
if (mCarCursorOption != null && mCarCursorOption !== DEFAULT_OPTION) {
|
||||
mCarCursorOption!!.destroy()
|
||||
}
|
||||
mCarCursorOption = try {
|
||||
option.clone()
|
||||
} catch (e: Exception) {
|
||||
DEFAULT_OPTION
|
||||
}
|
||||
val style = mMapView.getMapAutoViewHelper()!!.getMyLocationStyle()
|
||||
if (mCarCursorOption!!.carCursorBmp != null && !mCarCursorOption!!.carCursorBmp.isRecycled) {
|
||||
style!!.myLocationIcon(mCarCursorOption!!.carCursorBmp)
|
||||
} else {
|
||||
if (mCarCursorOption!!.carCursorRes != 0) {
|
||||
style!!.myLocationIcon(mCarCursorOption!!.carCursorRes)
|
||||
}
|
||||
}
|
||||
mMapView.getMapAutoViewHelper()!!.setMyLocationStyle(style!!)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置转向灯和刹车灯
|
||||
*
|
||||
* @param type :车尾灯类型
|
||||
* @param time 闪烁时间 最小500ms 小于500ms 默认为500ms
|
||||
*/
|
||||
override fun setCarLightsType(type: Int, time: Int) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.setTailLightsType(type, time)
|
||||
}
|
||||
}
|
||||
|
||||
override val mapCameraPosition: MapCameraPosition?
|
||||
get() {
|
||||
if (checkAMapView()) {
|
||||
val cameraPosition = mMapView.getMapAutoViewHelper()!!.getCameraPosition()
|
||||
return ObjectUtils.fromAMap(cameraPosition)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
override fun changeBearing(bearing: Float) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.setMapViewRotation(bearing)
|
||||
}
|
||||
}
|
||||
|
||||
override fun changeCurrentIcon(iconId: Int) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.getMyLocationStyle()!!.myLocationIcon(iconId, true)
|
||||
}
|
||||
}
|
||||
|
||||
override fun result(path: String) {
|
||||
invokeUploadLogFile(path)
|
||||
}
|
||||
|
||||
override fun onTouch(event: MotionEvent): Boolean {
|
||||
mogoMapListenerHandler.onTouch(event)
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onMapClick(lonLatPoint: LonLatPoint) {
|
||||
mogoMapListenerHandler.onMapClick(ObjectUtils.fromAMap(lonLatPoint))
|
||||
}
|
||||
|
||||
override fun onMapViewVisualAngleChange(type: Int) {
|
||||
d(SceneConstant.M_MAP + TAG, " 地图自动更改视距 currentThread : " + Thread.currentThread().name)
|
||||
currentMapVisualAngle = getVisualAngleMode(type)
|
||||
mogoMapListenerHandler.onMapVisualAngleChanged(currentMapVisualAngle)
|
||||
}
|
||||
|
||||
private fun getVisualAngleMode(mode: Int): VisualAngleMode {
|
||||
return when (mode) {
|
||||
0 -> VisualAngleMode.MODE_CLOSE_SIGHT
|
||||
1 -> VisualAngleMode.MODE_MEDIUM_SIGHT
|
||||
2 -> VisualAngleMode.MODE_LONG_SIGHT
|
||||
3 -> VisualAngleMode.MAP_STYLE_VR_ANGLE_300
|
||||
4 -> VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP
|
||||
5 -> VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
|
||||
7 -> VisualAngleMode.MAP_STYLE_VR_ROMA
|
||||
else -> VisualAngleMode.MODE_MEDIUM_SIGHT
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCameraChange(type: Int, value: Int) {}
|
||||
override fun onCameraChangeFinish(position: CameraPosition?) {
|
||||
position?.let {
|
||||
mogoMapListenerHandler.onMapChanged(
|
||||
ObjectUtils.fromAMap(position.target),
|
||||
position.zoom,
|
||||
position.tilt,
|
||||
position.bearing
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onChangeMapStyle(style: Int) {
|
||||
// CallerLogger.INSTANCE.d(M_MAP + TAG, "currentMapStyle = " + styleId + " , current = " + mCurrentUI);
|
||||
// 映射地图样式ID到鹰眼样式ID
|
||||
when (style) {
|
||||
MapAutoApi.MAP_STYLE_DAY, MapAutoApi.MAP_STYLE_DAY_NAV -> {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_NAV
|
||||
}
|
||||
MapAutoApi.MAP_STYLE_NIGHT -> {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT
|
||||
}
|
||||
MapAutoApi.MAP_STYLE_NIGHT_NAV -> {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_NAV
|
||||
}
|
||||
MapAutoApi.MAP_STYLE_NIGHT_VR -> {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR
|
||||
}
|
||||
MapAutoApi.MAP_STYLE_DAY_VR -> {
|
||||
mCurrentUI = EnumMapUI.MAP_STYLE_DAY_VR
|
||||
}
|
||||
}
|
||||
loadPreVehicleModel()
|
||||
mogoMapListenerHandler.onMapModeChanged(mCurrentUI)
|
||||
}
|
||||
|
||||
override fun onMarkClick(marker: Marker) {
|
||||
|
||||
}
|
||||
|
||||
override fun onRoamStatus(status: Int, msg: String) {
|
||||
invokeMapRomaStatus(status, msg)
|
||||
}
|
||||
|
||||
override fun rtkEnable(enable: Boolean) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getLocationClient()!!.rtkEnable(enable)
|
||||
}
|
||||
}
|
||||
|
||||
override fun stepInDayMode(isDayMode: Boolean) {
|
||||
// try {
|
||||
// if (mMapView != null && mMapView.getMapAutoViewHelper() != null) {
|
||||
// mMapView.getMapAutoViewHelper().setMapStyle();
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
override fun setMapDAngle(angle: Float) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.setMapDAngle(angle)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载3D模型
|
||||
*/
|
||||
private fun loadPreVehicleModel() {
|
||||
d(SceneConstant.M_MAP + TAG, "添加感知模型到地图中……")
|
||||
ThreadUtils.getIoPool().submit {
|
||||
addPreVehicleModelWeiZhi(
|
||||
TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI,
|
||||
"添加感知模型到地图中……preVehicleStrWeiZhi="
|
||||
)
|
||||
addPreVehicleModelWeiZhi(
|
||||
TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE,
|
||||
"添加感知模型到地图中……preVehicleStrPeople="
|
||||
)
|
||||
addPreVehicleModelWeiZhi(
|
||||
TrafficTypeEnum.TYPE_TRAFFIC_ID_BICYCLE,
|
||||
"添加感知模型到地图中……preVehicleStrBicycle="
|
||||
)
|
||||
addPreVehicleModelWeiZhi(
|
||||
TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE,
|
||||
"添加感知模型到地图中……preVehicleStrTaChe="
|
||||
)
|
||||
addPreVehicleModelWeiZhi(
|
||||
TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO,
|
||||
"添加感知模型到地图中……preVehicleStrMoto="
|
||||
)
|
||||
addPreVehicleModelWeiZhi(
|
||||
TrafficTypeEnum.TYPE_TRAFFIC_ID_BUS,
|
||||
"添加感知模型到地图中……preVehicleStrBus="
|
||||
)
|
||||
addPreVehicleModelWeiZhi(
|
||||
TrafficTypeEnum.TYPE_TRAFFIC_ID_TRUCK,
|
||||
"添加感知模型到地图中……preVehicleStrTruck="
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加模型到地图中
|
||||
*
|
||||
* @param typeTrafficId 障碍物类型ID
|
||||
* @param logMsg 日志消息
|
||||
*/
|
||||
private fun addPreVehicleModelWeiZhi(typeTrafficId: TrafficTypeEnum, logMsg: String) {
|
||||
// 根据当前的地图皮肤模式动态替换
|
||||
val preVehicleStrWeiZhi: String? = if (isDayMode) {
|
||||
map.addPreVehicleModel(typeTrafficId.type, typeTrafficId.traffic3DIconId)
|
||||
} else {
|
||||
map.addPreVehicleModel(typeTrafficId.type, typeTrafficId.traffic3DNightIconId)
|
||||
}
|
||||
d(SceneConstant.M_MAP + TAG, logMsg + preVehicleStrWeiZhi)
|
||||
if (preVehicleStrWeiZhi == null) {
|
||||
UiThreadHandler.postDelayed({
|
||||
w(SceneConstant.M_MAP + TAG, "添加感知模型到地图中失败,尝试重复添加……")
|
||||
addPreVehicleModelWeiZhi(typeTrafficId, logMsg)
|
||||
}, 1000L)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setLockMode(isLock: Boolean) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.setLockMode(isLock)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setScrollGesturesEnable(isEnable: Boolean) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.setScrollGesturesEnabled(isEnable)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setAllGesturesEnabled(isEnable: Boolean) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.setAllGesturesEnabled(isEnable)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setExtraGPSData(gnssInfo: MogoLocation) {
|
||||
val locationClient = mMapView.getLocationClient()
|
||||
if (locationClient != null) {
|
||||
locationClient.setIsUseExtraGPSData(true) //设置是否使用外界坐标
|
||||
locationClient.rtkEnable(true) //设置是否是高精定位
|
||||
val lonLatPoint = LonLatPoint()
|
||||
lonLatPoint.angle = gnssInfo.heading
|
||||
lonLatPoint.altitude = gnssInfo.altitude
|
||||
lonLatPoint.longitude = gnssInfo.longitude
|
||||
lonLatPoint.latitude = gnssInfo.latitude
|
||||
lonLatPoint.satelliteTime =
|
||||
java.lang.Double.valueOf((gnssInfo.satelliteTime * 1000).toDouble()).toLong()
|
||||
lonLatPoint.speed = gnssInfo.gnssSpeed.toDouble()
|
||||
locationClient.updateLocation(lonLatPoint) //更新新自动驾驶RTK相关数据
|
||||
setIsInit()
|
||||
}
|
||||
}
|
||||
|
||||
// 是否绘制点云
|
||||
override fun setIsDrawPointCloud(isDrawPointCloud: Boolean) {
|
||||
try {
|
||||
setIsDrawPointCloud(isDrawPointCloud, mMapView.getMapController())
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
//设置点云大小
|
||||
override fun setPointCloudSize(pointCloudSize: Float) {
|
||||
setPointCloudSize(pointCloudSize, mMapView.getMapController())
|
||||
}
|
||||
|
||||
// 设置点云颜色
|
||||
override fun setPointCloudColor(color: String) {
|
||||
setPointCloudColor(color, mMapView.getMapController())
|
||||
}
|
||||
|
||||
//更新点云
|
||||
override fun updatePointCloud(
|
||||
dataArray: ByteArray?, isTrasformer: Boolean, isResidual: Boolean, isReset: Boolean
|
||||
): Boolean {
|
||||
return updatePointCloudDataByPb(
|
||||
dataArray, isTrasformer, isResidual, isReset, mMapView.getMapController()
|
||||
)
|
||||
}
|
||||
|
||||
override fun animateTo(
|
||||
lon: Double,
|
||||
lat: Double,
|
||||
rotateAngle: Float,
|
||||
duration: Int,
|
||||
isGps: Boolean
|
||||
) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.animateTo(lon, lat, rotateAngle, duration, isGps)
|
||||
}
|
||||
}
|
||||
|
||||
override fun animateTo(
|
||||
lon: Double,
|
||||
lat: Double,
|
||||
v1: Float,
|
||||
v2: Float,
|
||||
v3: Float,
|
||||
v4: Float,
|
||||
duration: Int,
|
||||
isGps: Boolean
|
||||
) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.animateTo(lon, lat, v1, v2, v3, v4, duration, isGps)
|
||||
}
|
||||
}
|
||||
|
||||
override fun clear() {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.clearPanel()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,8 @@ package com.mogo.map;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay;
|
||||
import com.mogo.map.overlay.proxy.point.IMapPointOverlay;
|
||||
@@ -57,7 +59,7 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getUIController() {
|
||||
public IMogoMapUIController getUiController() {
|
||||
return mMapUIController;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,12 +9,9 @@ import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.zhidaoauto.map.sdk.open.HDTypes;
|
||||
import com.zhidaoauto.map.sdk.open.MapParams;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapStyleParams;
|
||||
|
||||
@@ -52,33 +49,6 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
mapAutoView = new MapAutoView(context, getStyleParams());
|
||||
}
|
||||
}
|
||||
//基础统一配置,如果各个样式地图有修改,此处需要改动
|
||||
if (mapAutoView.getMapStyleParams() != null) {
|
||||
mapAutoView.getMapStyleParams()
|
||||
.setIsWeatherEnable(false)
|
||||
.setLocationIcon3DRes(HdMapBuildConfig.currentCarVrIconRes)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_UP_CAR)
|
||||
.setHDVisibileArray(new int[]{HDTypes.DIVIDER.getType(), //onSurfaceCreate设置
|
||||
HDTypes.ROAD_AREA.getType(),
|
||||
HDTypes.STOP_LINE.getType(),
|
||||
HDTypes.ARROW.getType(),
|
||||
HDTypes.STATION_BRIDGE.getType(),
|
||||
HDTypes.ZEBRA_LINE.getType(),
|
||||
HDTypes.GREEN_BELT.getType(),
|
||||
HDTypes.DIVERSION.getType(),
|
||||
HDTypes.SAFE_ISLAND.getType(),
|
||||
HDTypes.ALPHANUMERIC.getType(),
|
||||
HDTypes.GUARDBAR.getType(),
|
||||
HDTypes.TRAFFIC_DEVICE.getType(),
|
||||
HDTypes.CABLE.getType(),
|
||||
HDTypes.SIGNAL_LINE.getType(),
|
||||
HDTypes.building.getType(),
|
||||
HDTypes.streetLight.getType(),
|
||||
HDTypes.area.getType(),
|
||||
HDTypes.regional.getType(),
|
||||
HDTypes.geometricLinear.getType(),
|
||||
HDTypes.geometricSurface.getType()});
|
||||
}
|
||||
if (mMapView == null) {
|
||||
mMapView = new AMapViewWrapper(mapAutoView);
|
||||
final View mapView = mMapView.getMapView();
|
||||
@@ -101,7 +71,7 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
}
|
||||
|
||||
protected IMogoMapUIController getUIController(){
|
||||
return mMapView.getMap().getUIController();
|
||||
return mMapView.getMap().getUiController();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -144,7 +114,7 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
}
|
||||
|
||||
public void setExtraGPSData(MogoLocation gnssInfo) {
|
||||
getMap().getUIController().setExtraGPSData(gnssInfo);
|
||||
getMap().getUiController().setExtraGPSData(gnssInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,9 +3,7 @@ package com.mogo.map.overlay
|
||||
import android.graphics.*
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.utilcode.util.*
|
||||
import com.mogo.map.MogoMap.Companion.DEFAULT
|
||||
import com.mogo.map.overlay.point.Point.Options
|
||||
import com.mogo.map.MogoMap.Companion.mapInstance
|
||||
import com.mogo.map.overlay.core.*
|
||||
@@ -261,7 +259,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
|
||||
|
||||
private fun moveToCenter(mapTag:String, id: String, eventLon: Double, eventLat: Double, carLon: Double, carLat: Double) {
|
||||
try {
|
||||
mapInstance.getMogoMap(mapTag).uiController.showBounds(
|
||||
mapInstance.getMogoMap(mapTag).uiController?.showBounds(
|
||||
id,
|
||||
MogoLatLng(carLat, carLon),
|
||||
listOf(MogoLatLng(eventLat, eventLon)),
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.map.overlay.point.Point.Options
|
||||
import com.mogo.map.overlay.proxy.point.*
|
||||
import com.mogo.map.utils.ObjectUtils
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
import com.zhidaoauto.map.sdk.open.marker.*
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
@@ -62,8 +62,8 @@ public class MogoMapUtils {
|
||||
final double dLon1 = Math.abs( carPosition.lon - latLngBounds.getSouthwest().getLongitude() );
|
||||
final double dLat2 = Math.abs( carPosition.lat - latLngBounds.getNortheast().getLatitude() );
|
||||
final double dLon2 = Math.abs( carPosition.lon - latLngBounds.getNortheast().getLongitude() );
|
||||
dLat = dLat1 > dLat2 ? dLat1 : dLat2;
|
||||
dLon = dLon1 > dLon2 ? dLon1 : dLon2;
|
||||
dLat = Math.max(dLat1, dLat2);
|
||||
dLon = Math.max(dLon1, dLon2);
|
||||
}
|
||||
|
||||
west = carPosition.lat - dLat;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mogo.map.utils;
|
||||
|
||||
import com.mogo.eagle.core.data.map.LonLatPoint;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.mogo.map.utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2021/3/8
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
public class ResIdCache {
|
||||
|
||||
public static Map< String, String > sMarkerCachesResMd5Values = new HashMap<>();
|
||||
|
||||
public static String getVal( String name ) {
|
||||
return sMarkerCachesResMd5Values.get( name );
|
||||
}
|
||||
|
||||
public static void putVal( String name, String val ) {
|
||||
sMarkerCachesResMd5Values.put( name, val );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user