diff --git a/libraries/map-custom/build.gradle b/libraries/map-custom/build.gradle index b08b482942..986849f098 100644 --- a/libraries/map-custom/build.gradle +++ b/libraries/map-custom/build.gradle @@ -67,7 +67,7 @@ dependencies { implementation project(':foudations:mogo-commons') } - implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.1.3' + implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.1.5' } apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString() diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java index bc680db52f..f1a887e85c 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/AMapViewWrapper.java @@ -251,7 +251,7 @@ public class AMapViewWrapper implements IMogoMapView, @Override public void setTrafficEnabled( boolean visible ) { if ( checkAMapView() ) { - mMapView.getMapAutoViewHelper().setTraffic( visible ); +// mMapView.getMapAutoViewHelper().setTraffic( visible ); } } diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java index 8fea64910c..0f687f677f 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/MarkerDrawer.java @@ -60,10 +60,14 @@ class MarkerDrawer { } public IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity, int zIndex, IMogoMarkerClickListener listener ) { + return drawMapMarkerImpl(markerShowEntity, zIndex, 0, listener); + } + + public IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity, int zIndex, int icon3DRes, IMogoMarkerClickListener listener ) { if ( markerShowEntity == null || markerShowEntity.getMarkerLocation() == null ) { return null; } - MogoMarkerOptions options = new MogoMarkerOptions().owner( markerShowEntity.getMarkerType() ).zIndex( zIndex ).object( markerShowEntity ).latitude( markerShowEntity.getMarkerLocation().getLat() ).longitude( markerShowEntity.getMarkerLocation().getLon() ); + MogoMarkerOptions options = new MogoMarkerOptions().icon3DRes( icon3DRes ).owner( markerShowEntity.getMarkerType() ).zIndex( zIndex ).object( markerShowEntity ).latitude( markerShowEntity.getMarkerLocation().getLat() ).longitude( markerShowEntity.getMarkerLocation().getLon() ); IMarkerView markerView = MapMarkerAdapter.getMarkerView( AbsMogoApplication.getApp(), markerShowEntity, options ); if ( markerView instanceof OnlineCarMarkerView ) { try { diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/OnlineCarDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/OnlineCarDrawer.java index 5829eee710..621692464e 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/OnlineCarDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/OnlineCarDrawer.java @@ -8,6 +8,7 @@ import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; import com.mogo.module.common.ModuleNames; import com.mogo.module.common.MogoApisHandler; +import com.mogo.module.common.R; import com.mogo.module.common.entity.MarkerCarPois; import com.mogo.module.common.entity.MarkerLocation; import com.mogo.module.common.entity.MarkerOnlineCar; @@ -104,7 +105,7 @@ class OnlineCarDrawer { String sn = MarkerDrawer.getInstance().getPrimaryKeyFromEntity( markerOnlineCar ); IMogoMarker mogoMarker = existCarMap.get( sn ); if ( mogoMarker == null || mogoMarker.isDestroyed() ) { - mogoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl( markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_LOW, listener ); + mogoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl( markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_LOW, R.raw.taxi, listener ); } if ( mogoMarker != null ) { mogoMarker.setVisible( true ); diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/RoadConditionDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/RoadConditionDrawer.java index 8fa79aaf08..fde64b7020 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/RoadConditionDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/RoadConditionDrawer.java @@ -9,6 +9,7 @@ import com.mogo.map.marker.IMogoMarkerClickListener; import com.mogo.map.marker.anim.OnMarkerAnimationListener; import com.mogo.module.common.ModuleNames; import com.mogo.module.common.MogoApisHandler; +import com.mogo.module.common.drawer.marker.RoadConditionInfoWindow3DAdapter; import com.mogo.module.common.entity.MarkerExploreWay; import com.mogo.module.common.entity.MarkerLocation; import com.mogo.module.common.entity.MarkerShowEntity; @@ -84,10 +85,16 @@ class RoadConditionDrawer { if ( mogoMarker == null || mogoMarker.isDestroyed() ) { Logger.d( TAG, "draw road condition, sn = %s", sn ); try { - if ( DebugConfig.isRoadEventAnimated() ) { - post2AddAndStartAnimation( markerShowEntity, i * 100L, listener ); - } else { + if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) { mogoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl( markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_HIGH, listener ); + mogoMarker.setInfoWindowAdapter( new RoadConditionInfoWindow3DAdapter( markerShowEntity, AbsMogoApplication.getApp(), mogoMarker.getMogoMarkerOptions() ) ); + mogoMarker.showInfoWindow(); + } else { + if ( DebugConfig.isRoadEventAnimated() ) { + post2AddAndStartAnimation( markerShowEntity, i * 100L, listener ); + } else { + mogoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl( markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_HIGH, listener ); + } } } catch ( Exception e ) { e.printStackTrace(); diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/RoadConditionInfoWindow3DAdapter.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/RoadConditionInfoWindow3DAdapter.java new file mode 100644 index 0000000000..374d3597a0 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/marker/RoadConditionInfoWindow3DAdapter.java @@ -0,0 +1,37 @@ +package com.mogo.module.common.drawer.marker; + +import android.content.Context; +import android.view.View; + +import com.mogo.map.marker.IMogoInfoWindowAdapter; +import com.mogo.map.marker.IMogoMarker; +import com.mogo.map.marker.MogoMarkerOptions; +import com.mogo.module.common.entity.MarkerShowEntity; + +public +/** + * @author congtaowang + * @since 2020/12/15 + * + * 描述 + */ +class RoadConditionInfoWindow3DAdapter implements IMogoInfoWindowAdapter { + + private MarkerShowEntity mEntity; + private Context mContext; + private MogoMarkerOptions mOptions; + + public RoadConditionInfoWindow3DAdapter( MarkerShowEntity entity, + Context context, + MogoMarkerOptions options ) { + this.mEntity = entity; + this.mContext = context; + this.mOptions = options; + } + + @Override + public View getInfoWindow( IMogoMarker marker ) { + IMarkerView creator = MapMarkerAdapter.getMarkerView( mContext, mEntity, mOptions ); + return creator.getView(); + } +} diff --git a/modules/mogo-module-common/src/main/res/raw/taxi.n3d b/modules/mogo-module-common/src/main/res/raw/taxi.n3d new file mode 100644 index 0000000000..8352a248bc Binary files /dev/null and b/modules/mogo-module-common/src/main/res/raw/taxi.n3d differ diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java index 03a9399a1b..6fc36fbb25 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java @@ -941,9 +941,11 @@ public class MogoServices implements IMogoMapListener, if ( ui == EnumMapUI.Type_VR ) { MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true ); MapCenterPointStrategy.resetByChangeMode(); + MapMarkerManager.getInstance().redrawMarkerByStyleChanged(); } else { MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, false ); MapCenterPointStrategy.resetByChangeMode(); + MapMarkerManager.getInstance().redrawMarkerByStyleChanged(); } } } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java index 2b7d073ed3..7561060acc 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java @@ -693,17 +693,21 @@ public class MapMarkerManager implements IMogoMarkerClickListener, // if ( !AppUtils.isAppForeground( mContext ) ) { // return; // } - if ( mLastDataResult != null ) { - runOnTargetThread( () -> { - MarkerServiceHandler.getMarkerManager().removeMarkers( ModuleNames.CARD_TYPE_ROAD_CONDITION ); - drawMarkerByCurrentType( mLastDataResult ); - mLastCheckMarker = null; - } ); - } + redrawMarkerByStyleChanged(); break; } } + public void redrawMarkerByStyleChanged(){ + if ( mLastDataResult != null ) { + runOnTargetThread( () -> { + MarkerServiceHandler.getMarkerManager().removeMarkers( ModuleNames.CARD_TYPE_ROAD_CONDITION ); + drawMarkerByCurrentType( mLastDataResult ); + mLastCheckMarker = null; + } ); + } + } + public void onCloseCurrentSelectedMarker(){ if ( mLastCheckMarker != null && !mLastCheckMarker.isDestroyed()) { closeMarker( mLastCheckMarker );