[3.4.0-map-sdk] wait to finish

This commit is contained in:
zhongchao
2023-08-25 10:16:15 +08:00
parent db342e0bfc
commit 7865da2347
40 changed files with 404 additions and 648 deletions

View File

@@ -8,6 +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:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>

View File

@@ -27,7 +27,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
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;
@@ -38,7 +37,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.bus.bean.BusRoutesResult;
@@ -49,8 +47,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;
import record_cache.RecordPanelOuterClass;
@@ -137,22 +133,18 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
mSwitchMapModeLayout.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl(View v) {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
//切换地图的远近视图
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
mapBizView.getUI().setLockMode(true);
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
mapBizView.getUI().setLockMode(false);
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
}
});
@@ -256,15 +248,12 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
protected abstract void onArriveStation();
private void updateSwitchMapIcon() {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
if (controller.getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
}
@@ -397,7 +386,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.bus_autopilot_2_status_bg));
// ctvAutopilotStatus.setSelected(true);
} else if (IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING
== autopilotStatus){
== autopilotStatus) {
ctvAutopilotStatusTv.setText(R.string.bus_pingxing_driver);
ctvAutopilotStatus.setClickable(false);
ctvAutopilotStatus.setBackground(getContext().getDrawable(R.drawable.pingxingjiashi));

View File

@@ -1,20 +1,23 @@
package com.mogo.och.bus.fragment;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
import static com.mogo.map.MogoMap.DEFAULT;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
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;
@@ -22,10 +25,10 @@ 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;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
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.bus.bean.BusStationBean;
import com.mogo.och.bus.constant.BusConst;
@@ -42,8 +45,10 @@ import com.mogo.och.common.module.utils.QRUtilsKt;
import com.mogo.och.common.module.wigets.BindQRCodeDialog;
import com.mogo.och.common.module.wigets.MarqueeTextView;
import com.mogo.och.common.module.wigets.OCHCommitDialog;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.List;
import me.jessyan.autosize.utils.AutoSizeUtils;
@@ -81,10 +86,11 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
if(loginService!=null){
loginService.registerFragment(this, getPresenter(),new LoginBusImpl());
if (loginService != null) {
loginService.registerFragment(this, getPresenter(), new LoginBusImpl());
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
@@ -113,35 +119,32 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
mSwitchLine.setOnClickListener(this);
mLineName.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
showHideTestBar();
return false;
}
mLineName.setOnLongClickListener(v -> {
showHideTestBar();
return false;
});
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void changeOverview(EventLogout eventLogout){
if (eventLogout.getMessgae() == EventLogout.LOGOUT_TYPE){
CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event消息去登出");
public void changeOverview(EventLogout eventLogout) {
if (eventLogout.getMessgae() == EventLogout.LOGOUT_TYPE) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "changeOverview Event消息去登出");
mPresenter.logout();
}else if (eventLogout.getMessgae() == EventLogout.SHOW_QR_TYPE){ //显示二维码
CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event qrcode");
} else if (eventLogout.getMessgae() == EventLogout.SHOW_QR_TYPE) { //显示二维码
CallerLogger.INSTANCE.d(M_BUS + TAG, "changeOverview Event qrcode");
String qrUrl = String.format(FunctionBuildConfig.urlJson.getBindDriverQRUrl(),
MoGoAiCloudClientConfig.getInstance().getSn());
Bitmap bmQr = QRUtilsKt.createQRCodeWithPicture(
BitmapFactory.decodeResource(getResources(), R.drawable.icon_qr_center_logo)
,qrUrl, AutoSizeUtils.dp2px(getContext(),340f),
AutoSizeUtils.dp2px(getContext(),340f),true);
if (bmQr != null){
, qrUrl, AutoSizeUtils.dp2px(getContext(), 340f),
AutoSizeUtils.dp2px(getContext(), 340f), true);
if (bmQr != null) {
BindQRCodeDialog.Builder builder = new BindQRCodeDialog.Builder();
builder.title(getString(R.string.bind_driver_qr_title))
.cancelStr(getString(R.string.qr_cancel))
.qrBm(bmQr).build(getContext()).show();
}else {
CallerLogger.INSTANCE.d(M_BUS + TAG,"bmQr = null ");
} else {
CallerLogger.INSTANCE.d(M_BUS + TAG, "bmQr = null ");
}
}
}
@@ -167,17 +170,17 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
super.onResume();
}
public void hideStationsPanel(){
public void hideStationsPanel() {
groupStationsPanel.setVisibility(View.GONE);
noDataView.setVisibility(View.VISIBLE);
}
public void showStationsPanel(){
public void showStationsPanel() {
groupStationsPanel.setVisibility(View.VISIBLE);
noDataView.setVisibility(View.GONE);
}
public void updateLineEmptyUI(){
public void updateLineEmptyUI() {
setArrivedClikable(false);
showOrHideSwitchLineBtn(true);
hideStationsPanel();
@@ -194,7 +197,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
public void updateBusTaskStatus(String lineName, String lineTime,
List<BusStationBean> stationList,
int arrivingOrArrivedIndex,
boolean isArrived){
boolean isArrived) {
if (getActivity() == null) {
return;
@@ -210,9 +213,9 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
showOrHideSwitchLineBtn(false);
mLineName.setText(lineName);
mTaskTime.setText(getString(R.string.bus_line_time_tag)+ lineTime);
mTaskTime.setText(getString(R.string.bus_line_time_tag) + lineTime);
// 渲染小巴路线数据
updateBusStationStatus(stationList,arrivingOrArrivedIndex,isArrived);
updateBusStationStatus(stationList, arrivingOrArrivedIndex, isArrived);
});
}
@@ -223,36 +226,36 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
startStation = stationList.get(0);
endStation = stationList.get(stationList.size() - 1);
if (arrivingOrArrivedIndex == stationList.size() - 1 && isArrived){
if (arrivingOrArrivedIndex == stationList.size() - 1 && isArrived) {
//切换路线和结束路线按钮切换
showSlidePanel("单程结束");
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
, endStation.getLon(),R.raw.end_marker);
}else if (arrivingOrArrivedIndex == 0 && isArrived){
, endStation.getLon(), R.raw.end_marker);
} else if (arrivingOrArrivedIndex == 0 && isArrived) {
showSlidePanel("滑动出发");
setOrRemoveMapMaker(true, BusConst.BUS_START_MAP_MAKER,
startStation.getLat(), startStation.getLon(),R.raw.star_marker);
startStation.getLat(), startStation.getLon(), R.raw.star_marker);
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER,
endStation.getLat(), endStation.getLon(),R.raw.end_marker);
}else{
if (isArrived){
endStation.getLat(), endStation.getLon(), R.raw.end_marker);
} else {
if (isArrived) {
// 重置滑动按钮文字
showSlidePanel("滑动出发");
}
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
, startStation.getLon(),R.raw.star_marker);
, startStation.getLon(), R.raw.star_marker);
setOrRemoveMapMaker(true, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
, endStation.getLon(),R.raw.end_marker);
, endStation.getLon(), R.raw.end_marker);
}
if (stationList.size() > 2){ //只有两个站点
updateMoreThanTwoStationsUI(stationList,arrivingOrArrivedIndex,isArrived);
}else {
updateTwoStationsUI(stationList,arrivingOrArrivedIndex,isArrived);
if (stationList.size() > 2) { //只有两个站点
updateMoreThanTwoStationsUI(stationList, arrivingOrArrivedIndex, isArrived);
} else {
updateTwoStationsUI(stationList, arrivingOrArrivedIndex, isArrived);
}
updateBusTestBarInfo();
@@ -260,6 +263,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
/**
* 有两个以上站点的路线
*
* @param stationList
* @param arrivingOrArrivedIndex
* @param isArrived
@@ -273,22 +277,22 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
secondStationItem.setVisibility(View.VISIBLE);
thirdStationItem.showOrHideStationArrowBg(false);
if (arrivingOrArrivedIndex == 0 || arrivingOrArrivedIndex -1 == 0
|| (arrivingOrArrivedIndex -2 == 0 && stationList.size() == 3)){
if (arrivingOrArrivedIndex == 0 || arrivingOrArrivedIndex - 1 == 0
|| (arrivingOrArrivedIndex - 2 == 0 && stationList.size() == 3)) {
firstStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_start));
}else {
} else {
firstStationItem.setStationTag("");
}
if (arrivingOrArrivedIndex + 1 == stationList.size() - 1 || arrivingOrArrivedIndex == stationList.size() - 1
|| (arrivingOrArrivedIndex == 0 && arrivingOrArrivedIndex + 2 == stationList.size() - 1)){ //确认是否显示 "终"
|| (arrivingOrArrivedIndex == 0 && arrivingOrArrivedIndex + 2 == stationList.size() - 1)) { //确认是否显示 "终"
thirdStationItem.setStationTag(getResources().getString(R.string.bus_station_txt_tag_end));
}else {
} else {
thirdStationItem.setStationTag("");
}
//圆点: 0:灰色 过站 1绿色 到站或者即将到站 2蓝色未到站
if (arrivingOrArrivedIndex == 0 && isArrived){
if (arrivingOrArrivedIndex == 0 && isArrived) {
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
@@ -304,13 +308,13 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
firstStationItem.setStationArrowBg(2);
secondStationItem.setStationArrowBg(2);
}else if (arrivingOrArrivedIndex == stationList.size() - 1){
} else if (arrivingOrArrivedIndex == stationList.size() - 1) {
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -2).getName());
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName());
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex - 2).getName());
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex - 1).getName());
thirdStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName());
firstStationItem.setStationPointBg(0);
@@ -318,18 +322,18 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
thirdStationItem.setStationPointBg(1);
firstStationItem.setStationArrowBg(0);
if (isArrived){
if (isArrived) {
secondStationItem.setStationArrowBg(0);
}else {
} else {
secondStationItem.setStationArrowBg(1);
}
}else {
} else {
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
secondStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex -1).getName());
firstStationItem.setStationName(stationList.get(arrivingOrArrivedIndex - 1).getName());
secondStationItem.setStationName(stationList.get(arrivingOrArrivedIndex).getName());
thirdStationItem.setStationName(stationList.get(arrivingOrArrivedIndex + 1).getName());
@@ -338,9 +342,9 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
thirdStationItem.setStationPointBg(2);
secondStationItem.setStationArrowBg(2);
if (isArrived){
if (isArrived) {
firstStationItem.setStationArrowBg(0);
}else {
} else {
firstStationItem.setStationArrowBg(1);
}
}
@@ -349,6 +353,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
/**
* 只有两个站点的路线
*
* @param stationList
* @param arrivingOrArrivedIndex
* @param isArrived
@@ -368,22 +373,22 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
thirdStationItem.setStationName(stationList.get(1).getName());
//圆点: 0:灰色 过站 1绿色 到站或者即将到站 2蓝色未到站
if (arrivingOrArrivedIndex == 0 && isArrived){//到站
if (arrivingOrArrivedIndex == 0 && isArrived) {//到站
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_arrived_station_name_text_color));
firstStationItem.setStationPointBg(1);
firstStationItem.setStationArrowBg(2);
thirdStationItem.setStationPointBg(0);
}else {
} else {
firstStationItem.setStationNameColor(getResources().getColor(R.color.bus_station_tag_txt_un_color));
thirdStationItem.setStationNameColor(getResources().getColor(R.color.bus_line_station_color_selected));
if (isArrived){ //到终点
if (isArrived) { //到终点
firstStationItem.setStationPointBg(0);
firstStationItem.setStationArrowBg(0);
thirdStationItem.setStationPointBg(1);
}else { //到终点途中
} else { //到终点途中
firstStationItem.setStationPointBg(0);
firstStationItem.setStationArrowBg(1);
thirdStationItem.setStationPointBg(1);
@@ -392,10 +397,10 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
}
private void showOrHideSwitchLineBtn(boolean isShow) {
if (isShow){//显示切换路线
if (isShow) {//显示切换路线
mSwitchLine.setTag(0);
mSwitchLine.setText(getResources().getString(R.string.bus_switch_line_btn));
}else {//显示结束路线
} else {//显示结束路线
mSwitchLine.setTag(1);
mSwitchLine.setText(getResources().getString(R.string.bus_close_line_btn));
}
@@ -425,7 +430,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
@Override
public void moveToEnd() {
// 开启自动驾驶到下一站
if (isAnimateRunning){
if (isAnimateRunning) {
stopAutopilotAnimation();
}
mPresenter.autoDriveToNextStation();
@@ -442,15 +447,15 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
}
}
public void clearBusStationsMarkers(){
CallerLogger.INSTANCE.d(M_BUS + TAG,"clearBusStationsMarkers()");
public void clearBusStationsMarkers() {
CallerLogger.INSTANCE.d(M_BUS + TAG, "clearBusStationsMarkers()");
if (null != startStation) {
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
, startStation.getLon(),R.raw.star_marker);
, startStation.getLon(), R.raw.star_marker);
}
if (null != endStation) {
setOrRemoveMapMaker(false, BusConst.BUS_END_MAP_MAKER, endStation.getLat()
, endStation.getLon(),R.raw.end_marker);
, endStation.getLon(), R.raw.end_marker);
}
//清除鹰眼右下角小地图轨迹
@@ -475,10 +480,10 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
* @param isAdd
* @param uuid
*/
private void setOrRemoveMapMaker(boolean isAdd, String uuid, double lat, double longi,int resourceId) {
private void setOrRemoveMapMaker(boolean isAdd, String uuid, double lat, double longi, int resourceId) {
if (isAdd) {
Runnable setMapMarkerRunnable = () -> {
CallerLogger.INSTANCE.d(M_BUS + "setMapMaker= "+Thread.currentThread().getName(),
CallerLogger.INSTANCE.d(M_BUS + "setMapMaker= " + Thread.currentThread().getName(),
uuid + "=latitude=" + lat + ",longitude=" + longi);
Point.Options.Builder builder = new Point.Options.Builder(BusConst.TYPE_MARKER_BUS_ORDER, Level.MAP_MARKER)
@@ -490,29 +495,27 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
.icon3DRes(resourceId)
.latitude(lat)
.longitude(longi);
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (mapUIController != null) {
CenterLine centerLine = mapUIController.getCenterLineInfo(
longi,lat,-1);
MapDataWrapper.INSTANCE.getCenterLineInfo(longi, lat, -1, centerLine -> {
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
Double angle = centerLine.getAngle();
if (angle != null) {
builder.rotate(angle.floatValue());
}
}
}
return null;
});
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if (overlayManager != null) {
overlayManager.showOrUpdatePoint(builder.build());
overlayManager.showOrUpdatePoint(builder.build(), DEFAULT);
}
};
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable);
}else {
} else {
Runnable removeMapMarkerRunnable = () -> {
CallerLogger.INSTANCE.d(M_BUS + "RemoveMapMaker="+Thread.currentThread().getName(),
uuid+"=latitude="+lat+",longitude="+longi);
CallerLogger.INSTANCE.d(M_BUS + "RemoveMapMaker=" + Thread.currentThread().getName(),
uuid + "=latitude=" + lat + ",longitude=" + longi);
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if (overlayManager != null) {
overlayManager.removePoint(uuid);
@@ -536,10 +539,10 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
ToastUtils.showLong(getResources().getString(R.string.bus_switch_line_btn_warning1));
return;
}
if ((int)mSwitchLine.getTag() == 0){//切换路线
if ((int) mSwitchLine.getTag() == 0) {//切换路线
Intent intent = new Intent(getContext(), BusSwitchLineActivity.class);
startActivity(intent);
}else {//结束任务
} else {//结束任务
OCHCommitDialog.Builder builder = new OCHCommitDialog.Builder();
OCHCommitDialog closeLineConfirmDialog = builder
.title(getString(R.string.bus_dialog_title))

View File

@@ -5,8 +5,6 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager.stepInDayMode
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.och.bus.passenger.constant.CharterPassengerConst
@@ -42,15 +40,6 @@ class MogoOCHBusPassenger : IMogoOCH {
}
/**
* 进入鹰眼模式,设置手势缩放地图失效
*/
private fun stepIntoVrMode() {
d(SceneConstant.M_TAXI_P + TAG, "进入vr模式")
getMapUIController()?.stepInVrMode(true) // 白天模式
stepInDayMode() //白天模式 状态栏字体颜色变黑
}
private fun showFragment() {
val supportFragmentManager: FragmentManager? = mActivity?.supportFragmentManager

View File

@@ -130,16 +130,16 @@ class BusPassengerPresenter(view: MainFragment?) :
override fun setCarChangeListener(productType: Int?) {
when (productType) {
OrderInfoResponse.M1_LOVE -> {
mView?.setCarModle(R.raw.aiqinghao)
mView?.setCarModel(R.raw.aiqinghao)
}
OrderInfoResponse.M1_FAMILY -> {
mView?.setCarModle(R.raw.jiatinghao)
mView?.setCarModel(R.raw.jiatinghao)
}
OrderInfoResponse.M1_FRIENDLY -> {
mView?.setCarModle(R.raw.pengyouhao)
mView?.setCarModel(R.raw.pengyouhao)
}
else -> {
mView?.setCarModle(R.raw.m1)
mView?.setCarModel(R.raw.m1)
}
}
}

View File

@@ -9,7 +9,6 @@ import com.amap.api.maps.model.LatLng
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.mvp.MvpFragment
import com.mogo.eagle.core.data.config.HdMapBuildConfig
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
import com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxButtonView
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
import com.mogo.eagle.core.function.view.SiteMarkerBean
@@ -111,13 +110,8 @@ class MainFragment :
}
aciv_map_2_default.setOnClickListener {
omvOverMap.displayCustomOverView()
val controller = getMapUIController()
if (controller != null) {
//切换到地图中间
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
// 切换缩放到中视角
controller.changeZoom2(0.8f)
}
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
mapBizView.getUI().changeZoom2(0.8f)
}
debug_arrive_dest.setOnClickListener {
@@ -183,8 +177,8 @@ class MainFragment :
tv_distance_arrive_time.text = arriveTime
}
fun setCarModle(rawInfo: Int){
getMapUIController()?.changeCurrentIcon(rawInfo)
fun setCarModel(rawInfo: Int){
mapBizView.getUI().changeCurrentIcon(rawInfo)
HdMapBuildConfig.currentCarVrIconRes = rawInfo
}

View File

@@ -8,6 +8,7 @@
android:id="@+id/mapBizView"
android:layout_width="0dp"
app:layout_constraintWidth_percent="0.662"
app:styleMode="MAP_STYLE_DAY_VR"
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@@ -22,7 +22,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.initAiCollect
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager.initBadCase
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showToolsView
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
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.DriverMsgBoxButtonView.ClickListener
@@ -104,22 +103,17 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
updateSwitchMapIcon()
mSwitchMapModeLayout!!.setOnClickListener(object : OnPreventFastClickListener() {
override fun onClickImpl(v: View) {
val controller = getMapUIController()
if (controller != null) {
//切换地图的远近视图
if (controller.currentMapVisualAngle.isLongSight) {
Objects.requireNonNull(getMapUIController())
?.setLockMode(true)
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
mapBizView?.let {
if (it.getUI().currentMapVisualAngle.isLongSight) {
it.getUI().setLockMode(true)
it.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
} else if (controller.currentMapVisualAngle.isMediumSight) {
Objects.requireNonNull(getMapUIController())
?.setLockMode(false)
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
} else if (it.getUI().currentMapVisualAngle.isMediumSight) {
it.getUI().setLockMode(false)
it.getUI().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_long)
} else {
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
it.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
}
}
@@ -268,11 +262,10 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
}
private fun updateSwitchMapIcon() {
val controller = getMapUIController()
if (controller != null) {
if (controller.currentMapVisualAngle.isLongSight) {
mapBizView?.let {
if (it.getUI().currentMapVisualAngle.isLongSight) {
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_long)
} else if (controller.currentMapVisualAngle.isMediumSight) {
} else if (it.getUI().currentMapVisualAngle.isMediumSight) {
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
} else {
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)

View File

@@ -1,16 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/clHmiContainer"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.mogo.eagle.core.function.view.MapBizView
android:id="@+id/mapBizView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugViewTrigger
android:layout_width="@dimen/dp_400"
android:layout_height="@dimen/dp_100"
@@ -27,15 +21,6 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -81,179 +66,6 @@
app:layout_constraintLeft_toLeftOf="@+id/viewSpeedChart"
app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart" />
<!--超视距-->
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
android:id="@+id/ivCameraIcon"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="45dp"
android:layout_marginEnd="40dp"
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
<!--限速牌子-->
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
android:id="@+id/viewLimitingVelocity"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginEnd="40dp"
android:elevation="@dimen/dp_10"
android:gravity="center"
android:text="60"
android:textColor="#FFFFFF"
android:textSize="60dp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
tools:visibility="visible" />
<!--红绿灯-->
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
android:id="@+id/viewTrafficLightVr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--地图视角切换-->
<com.mogo.eagle.core.function.hmi.ui.widget.PerspectiveSwitchView
android:id="@+id/viewPerspectiveSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="50dp"
android:layout_marginBottom="40dp"
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--隐藏态下的 美化模式按钮-->
<com.mogo.eagle.core.function.hmi.ui.switch.DemoModeHiddenSwitch
android:id="@+id/viewDemoModeSwitch"
android:layout_width="120dp"
android:layout_height="100dp"
android:layout_marginStart="40dp"
android:layout_marginBottom="200dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--工具箱-->
<com.mogo.eagle.core.function.hmi.ui.tools.ToolsImageView
android:id="@+id/ivToolsView"
android:layout_width="@dimen/module_hmi_check_size"
android:layout_height="@dimen/module_hmi_check_size"
android:layout_marginStart="25dp"
android:layout_marginBottom="40dp"
android:contentDescription="工具箱"
android:elevation="@dimen/dp_10"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
app:layout_goneMarginStart="50dp" />
<!--问题反馈-->
<ImageView
android:id="@+id/ivBadCaseTools"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginStart="50dp"
android:layout_marginBottom="40dp"
android:contentDescription="BadCase"
android:src="@drawable/bad_case_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/ivToolsView" />
<ImageView
android:id="@+id/ivAiCollectTools"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginStart="50dp"
android:layout_marginBottom="40dp"
android:contentDescription="数据采集"
android:src="@drawable/ai_collect_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools" />
<View
android:id="@+id/viewUpgradeTips"
android:layout_width="22dp"
android:layout_height="22dp"
android:background="@drawable/version_upgrade_tips_background"
android:translationZ="30dp"
android:visibility="gone"
app:layout_constraintCircle="@id/ivToolsView"
app:layout_constraintCircleAngle="45"
app:layout_constraintCircleRadius="60dp"
tools:ignore="MissingConstraints" />
<!--消息盒子司机端选择入口-->
<CheckBox
android:id="@+id/cbMsgBoxDriver"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="25dp"
android:background="@drawable/selector_msg_box"
android:button="@null"
android:visibility="visible"
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />
<!--司机端消息提示-->
<View
android:id="@+id/MsgBoxTipView"
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/version_upgrade_tips_background"
android:translationZ="30dp"
android:visibility="gone"
app:layout_constraintCircle="@id/cbMsgBoxDriver"
app:layout_constraintCircleAngle="40"
app:layout_constraintCircleRadius="32dp"
tools:ignore="MissingConstraints" />
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
android:id="@+id/viewDriverMsgBoxList"
android:layout_width="864px"
android:layout_height="746px"
android:layout_marginEnd="40dp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
tools:visibility="gone" />
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
android:id="@+id/viewDriverMsgBoxBubble"
android:layout_width="864px"
android:layout_height="wrap_content"
android:visibility="visible"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
tools:visibility="gone" />
<!--左右转向灯-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
android:id="@+id/turnLightView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="42dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--刹车ui-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.BrakeViewStatus
android:id="@+id/brakeView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="42dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--pnc行为决策-->
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
android:layout_width="wrap_content"

View File

@@ -9,6 +9,7 @@
android:id="@+id/mapBizView"
android:layout_width="1810dp"
android:layout_height="match_parent"
app:styleMode="MAP_STYLE_DAY_VR"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>

View File

@@ -5,9 +5,11 @@
android:layout_height="match_parent">
<!-- 高精地图 -->
<com.mogo.eagle.core.function.view.MapBizView
android:id="@+id/mapBizView"
app:styleMode="MAP_STYLE_DAY_VR"
app:carPosition="-0.5"
app:default_perspective="MAP_STYLE_VR_ERHAI_B2"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

View File

@@ -140,20 +140,17 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
mSwitchMapModeLayout.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl(View v) {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
if(mapBizView != null){
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
mapBizView.getUI().setLockMode(true);
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
mapBizView.getUI().setLockMode(false);
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
}
}
@@ -263,11 +260,10 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
protected abstract void onArriveStation();
private void updateSwitchMapIcon() {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
if (controller.getCurrentMapVisualAngle().isLongSight()) {
if(mapBizView != null){
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);

View File

@@ -1,6 +1,8 @@
package com.mogo.och.bus.fragment;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
import static com.mogo.map.MogoMap.DEFAULT;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -25,6 +27,7 @@ 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;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
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;
@@ -52,6 +55,8 @@ 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;
@@ -497,20 +502,18 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
.icon3DRes(resourceId)
.latitude(lat)
.longitude(longi);
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (mapUIController != null) {
CenterLine centerLine = mapUIController.getCenterLineInfo(
longi,lat,-1);
MapDataWrapper.INSTANCE.getCenterLineInfo(longi, lat, -1, centerLine -> {
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
Double angle = centerLine.getAngle();
if (angle != null) {
builder.rotate(angle.floatValue());
}
}
}
return null;
});
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if (overlayManager != null) {
overlayManager.showOrUpdatePoint(builder.build());
overlayManager.showOrUpdatePoint(builder.build(),DEFAULT);
}
};

View File

@@ -5,7 +5,6 @@ import android.view.View
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
@@ -53,7 +52,7 @@ class TaxiPassengerBaseFragment() :
*/
private var mStartAutopilotView: WeakReference<StartAutopilotView?>? = null
private var createProgressDialogAnim: AnimationsContainer?=null
private var createProgressDialogAnim: AnimationsContainer? = null
override fun getLayoutId(): Int {
return R.layout.taxi_p_base_fragment
@@ -73,8 +72,10 @@ class TaxiPassengerBaseFragment() :
overMapView.onCreateView(savedInstanceState)
overMapView.hideResetView()
createProgressDialogAnim = AnimationsContainer(R.array.xiaozhi_normal, 20,aciv_xiaozhi_normal)
createProgressDialogAnim?.setOnAnimStopListener(object :AnimationsContainer.OnAnimationStoppedListener{
createProgressDialogAnim =
AnimationsContainer(R.array.xiaozhi_normal, 20, aciv_xiaozhi_normal)
createProgressDialogAnim?.setOnAnimStopListener(object :
AnimationsContainer.OnAnimationStoppedListener {
override fun AnimationStopped() {
CallerLogger.d(M_TAXI_P + TAG, "动画暂停")
}
@@ -84,9 +85,9 @@ class TaxiPassengerBaseFragment() :
private fun initListener() {
ck_setting.isChecked = false
ck_setting.setOnCheckedChangeListener { _, isChecked ->
clSettingView.visibility = if(isChecked) View.VISIBLE else View.GONE
clSettingView.visibility = if (isChecked) View.VISIBLE else View.GONE
}
bottom.setOverMapApplyClick(object : BottomBar.ApplyClickLintener{
bottom.setOverMapApplyClick(object : BottomBar.ApplyClickLintener {
override fun onApplyClick(selectItem: BottomBar.SelectView) {
when (selectItem) {
BottomBar.SelectView.PRECISIONMAP -> {
@@ -140,13 +141,10 @@ class TaxiPassengerBaseFragment() :
rv_location_center.onClick {
when (bottom.getCurrentPage()) {
BottomBar.SelectView.PRECISIONMAP -> {
val controller = CallerMapUIServiceManager.getMapUIController()
if (controller != null) {
//切换到地图中间
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
// 切换缩放到中视角
controller.changeZoom2(0.8f)
}
//切换到地图中间
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
// 切换缩放到中视角
mapBizView.getUI().changeZoom2(0.8f)
}
BottomBar.SelectView.OVERMAPVIEW -> {
overMapView.displayCustomOverView()
@@ -157,10 +155,10 @@ class TaxiPassengerBaseFragment() :
}
view?.viewTreeObserver?.addOnWindowFocusChangeListener {
if(it){
if (it) {
CallerLogger.d(M_TAXI_P + TAG, "windows获取焦点")
createProgressDialogAnim?.start()
}else{
} else {
CallerLogger.d(M_TAXI_P + TAG, "window失去焦点")
createProgressDialogAnim?.stop()
}
@@ -219,19 +217,19 @@ class TaxiPassengerBaseFragment() :
*/
fun showOrHideServingOrderFragment(isShow: Boolean) {
when (bottom.getCurrentPage()) {
BottomBar.SelectView.OVERMAPVIEW,BottomBar.SelectView.PRECISIONMAP -> {
BottomBar.SelectView.OVERMAPVIEW, BottomBar.SelectView.PRECISIONMAP -> {
if (isShow) {
if(itinerary.visibility!=View.VISIBLE) {
if (itinerary.visibility != View.VISIBLE) {
itinerary.visibility = View.VISIBLE
}
} else {
if(itinerary.visibility!=View.GONE) {
if (itinerary.visibility != View.GONE) {
itinerary.visibility = View.GONE
}
}
}
BottomBar.SelectView.VIDEO,BottomBar.SelectView.NONE -> {
if(itinerary.visibility!=View.GONE) {
BottomBar.SelectView.VIDEO, BottomBar.SelectView.NONE -> {
if (itinerary.visibility != View.GONE) {
itinerary.visibility = View.GONE
}
}
@@ -295,7 +293,7 @@ class TaxiPassengerBaseFragment() :
infoVideoView.exitFullScreenMode(resetVideoPlayer)
}
fun showOrHideOverMapView(){
fun showOrHideOverMapView() {
overMapView?.clearV2XMarkers()
overMapView?.clearCustomPolyline()
}

View File

@@ -31,6 +31,7 @@
<!-- 高精地图 -->
<com.mogo.eagle.core.function.view.MapBizView
android:id="@+id/mapBizView"
app:styleMode="MAP_STYLE_DAY_VR"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

View File

@@ -31,7 +31,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
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;
@@ -42,13 +41,11 @@ import com.mogo.eagle.core.utilcode.mogo.view.OnPreventFastClickListener;
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.uicontroller.IMogoMapUIController;
import com.mogo.map.uicontroller.VisualAngleMode;
import com.mogo.och.common.module.utils.AnimatorDrawableUtil;
import com.mogo.och.taxi.R;
import java.util.Arrays;
import java.util.Objects;
import bag_manager.BagManagerOuterClass;
import mogo.telematics.pad.MessagePad;
@@ -189,16 +186,14 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
//视角切换
long start = SystemClock.elapsedRealtime();
try {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
if(mapBizView != null){
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
mapBizView.getUI().setLockMode(true);
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
mapBizView.getUI().setLockMode(false);
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
} else {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
@@ -323,11 +318,10 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
}
private void updateSwitchMapIcon() {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
if (controller.getCurrentMapVisualAngle().isLongSight()) {
if(mapBizView != null){
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
} else {
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);

View File

@@ -1,6 +1,7 @@
package com.mogo.och.taxi.ui;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_TAXI;
import static com.mogo.map.MogoMap.DEFAULT;
import android.app.Activity;
import android.graphics.Color;
@@ -26,10 +27,10 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
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.common.module.map.AmapNaviToDestinationModel;
import com.mogo.och.common.module.map.ICommonNaviChangedCallback;
import com.mogo.och.common.module.utils.DateTimeUtil;
@@ -766,20 +767,18 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
.icon3DRes(resourceId)
.latitude(station.get(1))
.longitude(station.get(0));
IMogoMapUIController mapUIController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (mapUIController != null) {
CenterLine centerLine = mapUIController.getCenterLineInfo(station.get(0)
, station.get(1), -1);
if (null != centerLine) {// 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
MapDataWrapper.INSTANCE.getCenterLineInfo(station.get(0), station.get(1), -1, centerLine -> {
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致 地图未初始化会返回空
Double angle = centerLine.getAngle();
if (angle != null) {
builder.rotate(angle.floatValue());
}
}
}
return null;
});
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if (overlayManager != null) {
overlayManager.showOrUpdatePoint(builder.build());
overlayManager.showOrUpdatePoint(builder.build(),DEFAULT);
}
};
OCHThreadPoolManager.getsInstance().execute(setMapMarkerRunnable);

View File

@@ -223,11 +223,10 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
}
private void updateSwitchMapIcon() {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
if (controller.getCurrentMapVisualAngle().isLongSight()) {
if(mapBizView != null){
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
@@ -399,24 +398,15 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
mSwitchMapModeImage.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl(View v) {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
if(mapBizView != null){
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS, BusConst.TYPE_MARKER_BUS_ORDER);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
} else {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
}
}

View File

@@ -158,11 +158,10 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
}
private void updateSwitchMapIcon() {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
if (controller.getCurrentMapVisualAngle().isLongSight()) {
if(mapBizView != null){
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
} else {
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
@@ -338,25 +337,15 @@ public abstract class BaseSweeperTabFragment<V extends IView, P extends Presente
mSwitchMapModeImage.setOnClickListener(new OnPreventFastClickListener() {
@Override
public void onClickImpl(View v) {
IMogoMapUIController controller = CallerMapUIServiceManager.INSTANCE.getMapUIController();
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
if(mapBizView != null){
if (mapBizView.getUI().getCurrentMapVisualAngle().isLongSight()) {
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_small_selector);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
// .inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS, BusConst.TYPE_MARKER_BUS_ORDER);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
} else if (mapBizView.getUI().getCurrentMapVisualAngle().isMediumSight()) {
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
} else {
// 2.11.0去掉
// MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).visibleAllMarkers();
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mapBizView.getUI().changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.sweeper_switch_map_big_selector);
}
}

View File

@@ -131,61 +131,12 @@ object ConfigStartUp {
}
}
//todo 多实例优化
val mapParams = MapParams.init()
mapParams.setDebugMode(false) // 1-使用本地地图数据0-使用在线地图数据
//.setDataFileSource(1)
mapParams.setDebugMode(false)
// 1-使用本地地图数据0-使用在线地图数据
// .setDataFileSource(1)
.setIsRecordLogs(false)
.setIsWeatherEnable(false)
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_UP_CAR)
.setHDVisibileArray(
intArrayOf(
HDTypes.DIVIDER.type,
HDTypes.ROAD_AREA.type,
HDTypes.STOP_LINE.type,
HDTypes.ARROW.type,
HDTypes.STATION_BRIDGE.type,
HDTypes.ZEBRA_LINE.type,
HDTypes.GREEN_BELT.type,
HDTypes.DIVERSION.type,
HDTypes.SAFE_ISLAND.type,
HDTypes.ALPHANUMERIC.type,
HDTypes.GUARDBAR.type,
HDTypes.TRAFFIC_DEVICE.type,
HDTypes.CABLE.type,
HDTypes.SIGNAL_LINE.type,
HDTypes.building.type,
HDTypes.streetLight.type,
HDTypes.area.type,
HDTypes.regional.type,
HDTypes.geometricLinear.type,
HDTypes.geometricSurface.type
)
)
// .setZoom( 20 )
// .setPointToCenter( 0.734375f, 0.5f )
//todo 2D模式下需要注意ADAS部分遮挡
//.setPointToCenter(0.5f, 0.5f)
// 根据 FunctionBuildConfig 配置的皮肤样式设置题图的样式
if (FunctionBuildConfig.skinMode == 1) {
mapParams.setStyleMode(MapParams.MAP_STYLE_DAY_VR)
} else {
mapParams.setStyleMode(MapParams.MAP_STYLE_NIGHT_VR)
}
//todo 临时放在这 @梁利辉
if (AppIdentityModeUtils.isBusPassenger(FunctionBuildConfig.appIdentityMode)) {
mapParams.setShadowEnable(false)
}
if(AppIdentityModeUtils.isShuttlePassenger(FunctionBuildConfig.appIdentityMode)) {
// shuttle m2 车需要偏移
if (AppIdentityModeUtils.isM2(FunctionBuildConfig.appIdentityMode)) {
mapParams.setCarPosition(-0.5f)
mapParams.setDefaultPerspective(MapParams.MAP_STYLE_VR_ERHAI_B2)
}
}
MapAutoApi.init(context, mapParams)
}

View File

@@ -20,6 +20,8 @@ import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandl
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_CROSS_ROAD
import com.mogo.eagle.function.biz.v2x.trafficlight.core.TrafficLightThreadHandler.Companion.MSG_WHAT_STOP_SEARCH_TRAFFIC_LIGHT
import com.mogo.eagle.function.biz.v2x.trafficlight.network.TrafficLightNetWorkModel
import com.mogo.map.MogoData
import com.mogo.map.MogoData.Companion.mogoMapData
class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
@@ -58,8 +60,7 @@ class MogoTrafficLightManager : IMoGoChassisLocationGCJ02Listener {
}
firstLoopCrossRoad = false
mLocation?.let { it ->
val tileId = CallerMapUIServiceManager.getMapUIController()
?.getTileId(it.longitude, it.latitude) ?: 0
val tileId = mogoMapData.get().getTileId(it.longitude, it.latitude)
trafficLightNetWorkModel.requestRoadID(
tileId, it.latitude, it.longitude, it.heading,
{

View File

@@ -1,6 +1,7 @@
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;
@@ -93,7 +94,7 @@ public class V2XScenarioManager implements IV2XScenarioManager {
* 道路事件触发后,切换到中景
*/
private void sceneChange() {
IMogoMapUIController mapUiController = CallerMapUIServiceManager.INSTANCE.getMapUIController();
IMogoMapUIController mapUiController = CallerMapUIServiceManager.INSTANCE.getMapUIController(DEFAULT);
if (mapUiController != null && mapUiController.getCurrentMapVisualAngle() != VisualAngleMode.MODE_MEDIUM_SIGHT) {
mapUiController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.road;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_V2X;
import static com.mogo.map.MogoMap.DEFAULT;
import androidx.core.util.Pair;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
@@ -54,7 +55,7 @@ public class V2XRoadEventMarker implements IV2XMarker<V2XRoadEventEntity> {
.longitude(entity.getLocation().getLon())
.latitude(entity.getLocation().getLat())
.set3DMode(true)
.icon3DRes(EventTypeEnumNew.getMarker3DRes(entity.getPoiType())).build());
.icon3DRes(EventTypeEnumNew.getMarker3DRes(entity.getPoiType())).build(),DEFAULT);
if (point != null) {
V2XBizTrace.Companion.onAck("V2XRoadEventMarker -> --- add Marker type: ", entity.getPoiType());
ArrayList<Point> markers = new ArrayList<>();

View File

@@ -6,13 +6,15 @@ import com.mogo.eagle.core.data.enums.DataSourceType;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener;
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.v2x.CallerLimitingVelocityListenerManager;
import com.mogo.map.MapDataWrapper;
import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
/**
* 限速
*
@@ -47,17 +49,20 @@ public class SpeedLimitDataManager implements IMoGoChassisLocationWGS84Listener
@Override
public void run() {
if (mLocation != null) {
if (CallerMapUIServiceManager.INSTANCE.getMapUIController() != null) {
getSpeedLimit();
}
getSpeedLimit();
}
}
private void getSpeedLimit() {
int speedLimit = Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading());
if (speedLimit > 0) {
CallerLimitingVelocityListenerManager.INSTANCE.invokeUnion(speedLimit, DataSourceType.MAP);
}
MapDataWrapper.INSTANCE.getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), (float) mLocation.getHeading(), new Function1<Integer, Unit>() {
@Override
public Unit invoke(Integer integer) {
if (integer != null && integer > 0) {
CallerLimitingVelocityListenerManager.INSTANCE.invokeUnion(integer, DataSourceType.MAP);
}
return null;
}
});
}
}

View File

@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import mogo.telematics.pad.MessagePad.*
object TrackerSourceFilterHelper {
@@ -12,7 +11,8 @@ object TrackerSourceFilterHelper {
@SuppressLint("NewApi")
fun filterData(data: TrackedObject): Boolean {
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && (data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type
|| data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type)) {
|| data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type)
) {
return true
}
var trackIPCFilter = true
@@ -32,7 +32,7 @@ object TrackerSourceFilterHelper {
}
}
4 -> {
if(isV2nRSM(data).second){
if (isV2nRSM(data).second) {
trackIPCFilter = false
}
}
@@ -65,12 +65,10 @@ object TrackerSourceFilterHelper {
}
//僵尸车
if(data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE){
if (data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE) {
color = "#7A8499FF"
CallerMapUIServiceManager.getMapUIController()?.let {
if(it.isDayMode){
color = "#9BA8BCFF"
}
if (FunctionBuildConfig.skinMode == 1) {
color = "#9BA8BCFF"
}
//消息埋点
CallerFuncBizListenerManager.invokeAttrZombieAnalyticsEvent()

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.function.business.routeoverlay;
import static com.mogo.map.MogoMap.DEFAULT;
import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Handler;
@@ -197,7 +199,7 @@ public class RouteOverlayDrawer {
if (mPolylineOptions == null) {
mPolylineOptions = options;
}
overlayManager.showOrUpdateLine(options);
overlayManager.showOrUpdateLine(options,DEFAULT);
} else {
isExcept = true;
}

View File

@@ -1,44 +0,0 @@
package com.mogo.eagle.core.function.impl;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
import com.mogo.eagle.core.function.api.map.IMogoMapService;
import com.mogo.map.MoGoOverlayManager;
import com.mogo.map.MogoMapUIController;
import com.mogo.map.location.GDLocationClient;
import com.mogo.map.location.IMogoGDLocationClient;
import com.mogo.map.overlay.IMoGoOverlayManager;
import com.mogo.map.uicontroller.IMogoMapUIController;
/**
* @author congtaowang
* @since 2019-12-18
* <p>
* 地图对外地接口
*/
@Route(path = MogoServicePaths.PATH_SERVICES_MAP)
public class MogoMapService implements IMogoMapService {
//todo 多实例主动设置IMap对象下面接口返回对应IMap实例的接口数据
@Override
public IMogoMapUIController getMapUIController() {
return MogoMapUIController.getInstance();
}
@Override
public IMoGoOverlayManager getOverlayManager() {
return MoGoOverlayManager.INSTANCE.overlay();
}
@Override
public IMogoGDLocationClient getGDLocationServer() {
return GDLocationClient.Companion.getGdLocationClient();
}
@Override
public void init(Context context) {
}
}

View File

@@ -0,0 +1,38 @@
package com.mogo.eagle.core.function.impl
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
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
import com.mogo.map.location.IMogoGDLocationClient
/**
* @author congtaowang
* @since 2019-12-18
*
*
* 地图对外地接口,多实例情况下,如果某个业务需要在多个地图上展示,需要业务提供监听接口,各个地图实例监听实现
*/
@Route(path = MogoServicePaths.PATH_SERVICES_MAP)
class MogoMapService : IMogoMapService {
override fun getMapUIController(mapTag:String): IMogoMapUIController {
return mapInstance.getMogoMap().uiController
}
override fun getOverlayManager(): IMoGoOverlayManager {
return overlay()
}
override fun getGDLocationServer(): IMogoGDLocationClient {
return gdLocationClient
}
override fun init(context: Context) {}
}

View File

@@ -14,6 +14,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84Lis
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
class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs),
@@ -60,6 +61,10 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
}
}
fun getUI(): IMogoMapUIController {
return uiController
}
override fun onSaveInstanceState(outState: Bundle?) {
super.onSaveInstanceState(outState)
}
@@ -74,9 +79,9 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
override fun onSkinModeChange(skinMode: Int) {
if (skinMode == 0) {
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(false)
getUI().stepInVrMode(false)
} else if (skinMode == 1) {
CallerMapUIServiceManager.getMapUIController()?.stepInVrMode(true)
getUI().stepInVrMode(true)
}
}
@@ -107,9 +112,9 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
private fun turn(lightNum: Int) {
if (currentLevel != lightNum) {
when (lightNum) {
0 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500)
1 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(1, 500)
2 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
0 -> getUI().setCarLightsType(0, 500)
1 -> getUI().setCarLightsType(1, 500)
2 -> getUI().setCarLightsType(2, 500)
}
currentLevel = lightNum
}

View File

@@ -1,38 +0,0 @@
package com.mogo.eagle.core.function.api.map;
import android.content.Context;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.mogo.map.location.IMogoGDLocationClient;
import com.mogo.map.overlay.IMoGoOverlayManager;
import com.mogo.map.uicontroller.IMogoMapUIController;
/**
* @author congtaowang
* @since 2019-12-18
* <p>
* 地图对外接口
*/
public interface IMogoMapService extends IProvider {
/**
* 地图UI控制
*
* @return
*/
IMogoMapUIController getMapUIController();
/**
* 覆盖物操作
* @return
*/
IMoGoOverlayManager getOverlayManager();
/**
* 获取高德定位服务
*
* @return
*/
IMogoGDLocationClient getGDLocationServer();
}

View File

@@ -0,0 +1,30 @@
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
interface IMogoMapService :IProvider {
/**
* 地图UI控制
*
* @return
*/
fun getMapUIController(mapTag:String): IMogoMapUIController
/**
* 覆盖物操作
* @return
*/
fun getOverlayManager(): IMoGoOverlayManager
/**
* 获取高德定位服务
*
* @return
*/
fun getGDLocationServer(): IMogoGDLocationClient
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.call.map
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.map.IMogoMapService
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.map.MogoMap.Companion.DEFAULT
import com.mogo.map.location.IMogoGDLocationClient
import com.mogo.map.overlay.*
import com.mogo.map.uicontroller.IMogoMapUIController
@@ -15,20 +16,21 @@ object CallerMapUIServiceManager {
)
}
fun getMapUIController(): IMogoMapUIController? {
return serviceProvider?.mapUIController
//todo 多实例
fun getMapUIController(mapTag:String = DEFAULT): IMogoMapUIController? {
return serviceProvider?.getMapUIController(mapTag)
}
fun getOverlayManager(): IMoGoOverlayManager? {
return serviceProvider?.overlayManager
return serviceProvider?.getOverlayManager()
}
fun getGDLocationServer(): IMogoGDLocationClient?{
return serviceProvider?.gdLocationServer
return serviceProvider?.getGDLocationServer()
}
fun getCityCode(): String? {
return serviceProvider?.gdLocationServer?.lastCityCode
return serviceProvider?.getGDLocationServer()?.lastCityCode
}
}

View File

@@ -14,13 +14,14 @@ object CallerVisualAngleManager {
private val provider by lazy { ARouter.getInstance().build(MogoServicePaths.PATH_VISUAL_ANGLE)
.navigation() as? IMoGoVisualAngleChangeProvider
}
·
fun init() {
provider?.let {
Log.d("CallerVisualAngle", "--- init ---")
}
}
//todo 多实例
fun changeAngle(scene: Scene) {
provider?.changeAngle(scene)

View File

@@ -9,7 +9,6 @@ import com.autonavi.nge.map.MapView
import com.zhidaoauto.map.data.point.LonLatPoint
import com.zhidaoauto.map.sdk.inner.CompileConfig
import com.zhidaoauto.map.sdk.inner.abs.IEventController
import com.zhidaoauto.map.sdk.inner.abs.IMarkerController
import com.zhidaoauto.map.sdk.inner.common.CommonHelper
import com.zhidaoauto.map.sdk.inner.common.ConstantExt
import com.zhidaoauto.map.sdk.inner.common.MapHelper
@@ -25,16 +24,15 @@ import com.zhidaoauto.map.sdk.inner.utils.MathUtils
import com.zhidaoauto.map.sdk.inner.utils.Recorder
import com.zhidaoauto.map.sdk.inner.utils.TransformUtils
import com.zhidaoauto.map.sdk.open.abs.log.ILog
import com.zhidaoauto.map.sdk.open.abs.marker.InfoWindowAdapter
import com.zhidaoauto.map.sdk.open.abs.navi.INaviResult
import com.zhidaoauto.map.sdk.open.data.MapDataApi
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle
import com.zhidaoauto.map.sdk.open.navi.NaviModel
import com.zhidaoauto.map.sdk.open.tools.MapTools
import com.zhidaoauto.map.sdk.open.view.MapAutoView
import io.netty.buffer.Unpooled
import java.math.BigDecimal
import java.nio.charset.Charset
import kotlin.math.pow
object MapAutoApi {
@@ -180,8 +178,7 @@ object MapAutoApi {
// Convert the longitude and latitude to Morton code
val code = toMortonCode(lon, lat)
// Calculate the tile ID based on the Morton code and the tile level
val tileId = getTileIdByMortonCode(code, level)
return tileId
return getTileIdByMortonCode(code, level)
}
@@ -296,7 +293,7 @@ object MapAutoApi {
private fun getTileIdByMortonCode(mortonCode:Long, level:Int):Long {
val left = ((mortonCode shr (2 * (31 - level))) and 0xffffffff)
val right = (Math.pow(2.0,(16.0 + level)).toLong())
val right = (2.0.pow((16.0 + level)).toLong())
// println("tile:$left,$right")
return (left +right)
}

View File

@@ -1,5 +1,6 @@
package com.zhidaoauto.map.sdk.open.view
import android.annotation.SuppressLint
import android.content.Context
import android.os.Bundle
import android.os.Handler
@@ -10,7 +11,6 @@ import android.widget.FrameLayout
import com.autonavi.nge.map.*
import com.zhidao.map.net.api.Result
import com.zhidaoauto.map.data.point.LonLatPoint
import com.zhidaoauto.map.sdk.BuildConfig
import com.zhidaoauto.map.sdk.R
import com.zhidaoauto.map.sdk.inner.CompileConfig
import com.zhidaoauto.map.sdk.inner.abs.*
@@ -124,7 +124,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
private val weatherRepository by lazy { WeatherRepository() }
private var isFirstInit = true
constructor(context: Context) : super(context) {
constructor(context: Context) : super(context) {
initView()
}
@@ -151,8 +151,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
init(context)
}
fun obtainMapStyleParams(context: Context, attrs: AttributeSet?){
private fun obtainMapStyleParams(context: Context, attrs: AttributeSet?){
// 获取自定义属性值
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.MapAutoView)
var zoom = typedArray.getInt(R.styleable.MapAutoView_zoom, 20)
@@ -412,7 +411,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
mHandler.sendMessage(msg)
}
} else {
var lonLat = LonLat(lonLatPoint.longitude, lonLatPoint.latitude)
val lonLat = LonLat(lonLatPoint.longitude, lonLatPoint.latitude)
if (CompileConfig.DEBUG) {
Log.i(TAG, "autoop---locationop-lockop-centerop--elseop-setLonLat:${lonLat},${lonLatPoint.angle}")
}
@@ -474,7 +473,8 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
}
private val mHandler = object : Handler() {
private val mHandler = @SuppressLint("HandlerLeak")
object : Handler() {
override fun handleMessage(msg: Message) {
when (msg.what) {
MSG_MAP_INIT -> {
@@ -549,7 +549,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
mLocationLon = lonLatPoint.longitude
mLocationAlt = lonLatPoint.altitude.toFloat()
mLocationHeading = lonLatPoint.angle
var heading = lonLatPoint.angle
val heading = lonLatPoint.angle
if (CompileConfig.DEBUG) {
Log.i(TAG, "autoop--centerop--lockcarop:-start:${lonLatPoint}")
@@ -882,15 +882,15 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
if(mEventController == null){
mEventController = MapEventController()
}
onRoadInfoListener?.let {
onRoadInfoListener.let {
mEventController?.addRoadInfoListener(it)
}
if(intervalTime == 0L){
mIntervalTimeRoadInfo = if(intervalTime == 0L){
return
}else if(intervalTime < 1000){
mIntervalTimeRoadInfo = 1000
1000
}else {
mIntervalTimeRoadInfo = intervalTime
intervalTime
}
}
@@ -978,9 +978,8 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
}
}
override fun getCurrentLonLatPoint(): LonLatPoint{
var lonLatPoint = LonLatPoint(mLocationLon, mLocationLat, mLocationAlt.toDouble(), mLocationHeading)
return lonLatPoint
override fun getCurrentLonLatPoint(): LonLatPoint {
return LonLatPoint(mLocationLon, mLocationLat, mLocationAlt.toDouble(), mLocationHeading)
}
fun setWeatherEnable(isEnable: Boolean){
@@ -1003,7 +1002,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
if (MapDataApi.isRightLonLat(mLocationLon, mLocationLat)) {
val result = weatherRepository.getInfo(mLocationLon, mLocationLat)
if (CompileConfig.DEBUG) {
Log.d(TAG, "getWeatherInfo--result: ${result}")
Log.d(TAG, "getWeatherInfo--result: $result")
}
if (result is Result.Success) {

View File

@@ -28,17 +28,17 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
public MogoBaseMapView( Context context, @Nullable AttributeSet attrs, int defStyleAttr ) {
super( context, attrs, defStyleAttr );
init( context );
init( context,attrs );
}
private void init( Context context ) {
addMapView( context );
private void init( Context context, AttributeSet attrs) {
addMapView( context, attrs );
if (mMapView != null){
MogoMap.Companion.getMapInstance().initInstance( mMapView.getMap() , getInstanceTag());
}
}
protected abstract void addMapView( Context context );
protected abstract void addMapView( Context context , AttributeSet attrs);
protected abstract String getInstanceTag();
@@ -85,7 +85,7 @@ public abstract class MogoBaseMapView extends FrameLayout implements ILifeCycle
}
}
public IMogoMap getMap() {
protected IMogoMap getMap() {
if ( mMapView != null ) {
return mMapView.getMap();
}

View File

@@ -11,6 +11,7 @@ class MogoMap private constructor() {
const val DEFAULT = "Default"
@JvmStatic
val mapInstance by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
MogoMap()
}
@@ -19,7 +20,7 @@ class MogoMap private constructor() {
private val mapCache = ConcurrentHashMap<String, IMogoMap>()
/**
* 缓存多实例对象
* 缓存多实例对象instanceTag未指定默认给予DEFAULT
*/
fun initInstance(map: IMogoMap, instanceTag: String = DEFAULT) {
if (mapCache.contains(instanceTag)) {

View File

@@ -1,5 +1,6 @@
package com.mogo.map.overlay
import com.mogo.map.MogoMap.Companion.DEFAULT
import com.mogo.map.overlay.core.*
import com.mogo.map.overlay.line.*
import com.mogo.map.overlay.point.*
@@ -8,7 +9,7 @@ import com.mogo.map.overlay.line.Polyline.Options as LineOptions
interface IMoGoOverlayManager {
fun showOrUpdatePoint(options: PointOptions): Point?
fun showOrUpdatePoint(options: PointOptions, mapTag:String = DEFAULT): Point?
fun hidePoint(id: String)
@@ -38,7 +39,7 @@ interface IMoGoOverlayManager {
fun showPoint(id: String)
fun showOrUpdateLine(options: LineOptions): Polyline?
fun showOrUpdateLine(options: LineOptions,mapTag:String = DEFAULT): Polyline?
fun hideLine(id: String)

View File

@@ -11,7 +11,11 @@ import androidx.annotation.Nullable;
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;
/**
@@ -39,9 +43,39 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
private MapAutoView mapAutoView;
@Override
protected void addMapView(Context context) {
protected void addMapView(Context context, AttributeSet attrs) {
if (mapAutoView == null) {
mapAutoView = new MapAutoView(context);
if (getStyleParams() == null) {
mapAutoView = new MapAutoView(context, attrs);
} else {
mapAutoView = new MapAutoView(context, getStyleParams());
}
}
//基础统一配置,如果各个样式地图有修改,此处需要改动
if (mapAutoView.getMapStyleParams() != null) {
mapAutoView.getMapStyleParams()
.setIsWeatherEnable(false)
.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);
@@ -54,6 +88,20 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
}
}
/**
* 子类实现
* 代码StyleParams和XML初始化设置同时仅支持一种
*
* @return MapStyleParams
*/
protected MapStyleParams getStyleParams() {
return null;
}
protected IMogoMapUIController getUIController(){
return mMapView.getMap().getUIController();
}
@Override
protected String getInstanceTag() {
return MogoMap.DEFAULT;

View File

@@ -5,6 +5,7 @@ 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.*
@@ -20,7 +21,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
private val lines by lazy { ConcurrentHashMap<Polyline, IMapPolylineOverlay>() }
override fun showOrUpdatePoint(options: Options): Point? {
override fun showOrUpdatePoint(options: Options, mapTag:String): Point? {
synchronized(points) {
val key = Point(options.id, options.owner, options.level, options)
var point = points[key]
@@ -29,7 +30,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
point.setOptions(options)
return key
} else {
val p = mapInstance.getMogoMap().addPoint(options)
val p = mapInstance.getMogoMap(mapTag).addPoint(options)
if (p != null) {
p.onRemove { removed ->
val keys = points.filterKeys { it.id == removed }
@@ -223,7 +224,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
}
}
override fun showOrUpdateLine(options: Polyline.Options): Polyline? {
override fun showOrUpdateLine(options: Polyline.Options,mapTag:String): Polyline? {
synchronized(lines) {
val key = Polyline(options.id, options.owner, options.level, options)
var line = lines[key]
@@ -232,7 +233,7 @@ internal class MoGoOverlayManagerImpl: IMoGoOverlayManager {
line.setOptions(options)
return key
} else {
val newLine = mapInstance.getMogoMap().addLine(options)
val newLine = mapInstance.getMogoMap(mapTag).addLine(options)
if (newLine != null) {
newLine.onRemove { removed ->
val keys = lines.filterKeys { it.id == removed }