Merge branch 'dev2_aiSdk' into qa_och_bus2
This commit is contained in:
@@ -155,19 +155,19 @@ LOGLIB_VERSION = 1.0.4
|
||||
|
||||
######## MogoAiCloudSDK Version
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.0.74
|
||||
MOGO_NETWORK_VERSION=1.0.84
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.0.74
|
||||
MOGO_PASSPORT_VERSION=1.0.84
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.0.74
|
||||
MOGO_SOCKET_VERSION=1.0.84
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.0.74
|
||||
MOGO_REALTIME_VERSION=1.0.84
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.0.74
|
||||
MOGO_TANLU_VERSION=1.0.84
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.0.74
|
||||
MOGO_LIVE_VERSION=1.0.84
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.74
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.84
|
||||
|
||||
######## Foundation MogoAiCloud Module
|
||||
# mogoAiCloud apk services
|
||||
|
||||
@@ -267,6 +267,11 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMarkerAssInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnMarkerClickListener( IMogoMarkerClickListener listener ) {
|
||||
mMogoMarkerClickListener = listener;
|
||||
|
||||
@@ -67,7 +67,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.13'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-8.5.15'
|
||||
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-test-3.4'
|
||||
}
|
||||
|
||||
|
||||
14
libraries/map-custom/map-version-update
Normal file
14
libraries/map-custom/map-version-update
Normal file
@@ -0,0 +1,14 @@
|
||||
group:com.zhidaoauto.machine:map:1.0.0-vr-
|
||||
|
||||
version note:
|
||||
8.5.15
|
||||
增加限速接口:
|
||||
MapDataApi.getLimitSpeed(lon: Double,lat: Double,angle: Float)
|
||||
|
||||
8.5.16
|
||||
增加远中近视角切换接口:
|
||||
mapAutoView.getMapAutoViewHelper()?.setMapViewVisualAngle(type)
|
||||
type 0=近景 1=中景 2=远景
|
||||
|
||||
视角切换监听事件
|
||||
mapAutoView.setOnMapViewVisualAngleChangeListener
|
||||
@@ -1,16 +1,18 @@
|
||||
package com.mogo.map.impl.custom;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.map.impl.custom.marker.AMapMarkerWrapper;
|
||||
import com.mogo.map.impl.custom.marker.MarkerWrapperClickHelper;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.marker.MogoMarkersHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static com.mogo.map.marker.MarkerType.MAP_STATIC;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-24
|
||||
@@ -25,9 +27,9 @@ public class AMapMarkerClickHandler {
|
||||
}
|
||||
|
||||
public static AMapMarkerClickHandler getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( AMapMarkerClickHandler.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (AMapMarkerClickHandler.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new AMapMarkerClickHandler();
|
||||
}
|
||||
}
|
||||
@@ -44,23 +46,32 @@ public class AMapMarkerClickHandler {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public boolean handleMarkerClicked( Marker marker ) {
|
||||
if ( marker == null ) {
|
||||
public boolean handleMarkerClicked(Marker marker) {
|
||||
if (marker == null) {
|
||||
return false;
|
||||
}
|
||||
Map< String, IMogoMarker > mogoMarkerMap = MarkerWrapperClickHelper.getInstance().getMogoMarkerMap();
|
||||
if ( mogoMarkerMap.containsKey( marker.getId() ) ) {
|
||||
IMogoMarker mogoMarker = mogoMarkerMap.get( marker.getId() );
|
||||
//地图道路上静态数,暂时只过滤traffic类型下发点击事件
|
||||
if (MarkerWrapperClickHelper.getInstance().isStaticMarker(marker.getId())){
|
||||
IMogoMarker iMogoMarker = new AMapMarkerWrapper(marker,new MogoMarkerOptions());
|
||||
iMogoMarker.setOwner(MAP_STATIC); //TODO 后续可能由于类型比较多,需要owner匹配机制,以及控制owner细粒度
|
||||
Logger.d("AMapMarkerWrapper", "traffic marker 点击回调");
|
||||
return MogoMarkersHandler.getInstance().onStaticMarkerClicked(iMogoMarker);
|
||||
}
|
||||
|
||||
Map<String, IMogoMarker> mogoMarkerMap = MarkerWrapperClickHelper.getInstance().getMogoMarkerMap();
|
||||
if (mogoMarkerMap.containsKey(marker.getId())) {
|
||||
IMogoMarker mogoMarker = mogoMarkerMap.get(marker.getId());
|
||||
final IMogoMarkerClickListener listener = mogoMarker.getOnMarkerClickListener();
|
||||
Logger.d( "AMapMarkerWrapper", "marker 点击回调:%s -> %s", mogoMarker, marker );
|
||||
if ( listener != null ) {
|
||||
boolean result = listener.onMarkerClicked( mogoMarker );
|
||||
if ( result ) {
|
||||
Logger.d("AMapMarkerWrapper", "marker 点击回调:%s -> %s", mogoMarker, marker);
|
||||
if (listener != null) {
|
||||
boolean result = listener.onMarkerClicked(mogoMarker);
|
||||
if (result) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return MogoMarkersHandler.getInstance().onMarkerClicked( mogoMarker );
|
||||
return MogoMarkersHandler.getInstance().onMarkerClicked(mogoMarker);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -762,26 +762,26 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
if (mSelfMarker == null) { //TODO mAdasResultConvert
|
||||
if (mSelfMarker == null) {
|
||||
try {
|
||||
mSelfMarker = mMapView.getMapAutoViewHelper().getMyLocationStyle().getSelfMarker();
|
||||
mSelfMarker.setInfoWindowEnable(true);
|
||||
|
||||
} catch (Exception e) {
|
||||
}
|
||||
// } else {
|
||||
// WorkThreadHandler.getInstance().postDelayed(() -> {
|
||||
|
||||
// }, 10000);
|
||||
} else {
|
||||
// 通过不同的方向类型来改变车模,目前暂定三种模型,drawlevel 1 绿,2 黄,3 红,绿色的时候需要把相应的切换为默认模型
|
||||
// if (mAdasResult.type == 1) {
|
||||
// Log.d("liyz", "-------1------>");
|
||||
// mSelfMarker.marker3DIcon(R.raw.car);
|
||||
// } else if (mAdasResult.type == 2) { //不处理
|
||||
//
|
||||
// } else if (mAdasResult.type == 3) { //切换前方模型
|
||||
// //继续判断相应的方位,目前是 前方 TODO
|
||||
// Logger.d("liyz", " mAdasResult.drawlevel = " + mAdasResult.drawlevel);
|
||||
// if (mAdasResult != null) {
|
||||
// if (mAdasResult.drawlevel == 1) {
|
||||
// mSelfMarker.marker3DIcon(R.raw.car);
|
||||
// } else if (mAdasResult.drawlevel == 2) { //不处理
|
||||
//
|
||||
// } else if (mAdasResult.drawlevel == 3) {
|
||||
// //继续判断相应的方位,目前是只有 前方 TODO
|
||||
// mSelfMarker.marker3DIcon(R.raw.car);
|
||||
// }
|
||||
// } else {
|
||||
// mSelfMarker.marker3DIcon(R.raw.car);
|
||||
// }
|
||||
}
|
||||
@@ -1121,7 +1121,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (roadCache == null || roadCache == noCache) {
|
||||
SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad(((float) wgs[0]), ((float) wgs[1]), ((float) angle), isGpsLocation, isRTK);
|
||||
if (singlePointRoadInfo != null && singlePointRoadInfo.getCoords() != null && !singlePointRoadInfo.getCoords().isEmpty()) {
|
||||
Log.i("timer-matchRoad-4", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + singlePointRoadInfo.getRoadId());
|
||||
// Log.i("timer-matchRoad-4", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + singlePointRoadInfo.getRoadId());
|
||||
roadCache = new RoadCacheWrapper(singlePointRoadInfo.getCoords());
|
||||
roadCache.setLaneWidth(singlePointRoadInfo.getLaneWidth());
|
||||
// 在地图上画点的测试方法
|
||||
@@ -1147,7 +1147,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
Log.i("timer-matchRoad-1", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
// Log.i("timer-matchRoad-1", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
if (roadCache != null
|
||||
&& roadCache.getRoad() != null
|
||||
&& !roadCache.getRoad().isEmpty()) {
|
||||
@@ -1159,16 +1159,16 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (matchThreshold > 0 && matchedPoint[2] > 0 && matchedPoint[2] <= matchThreshold) {
|
||||
// 目标车在阈值范围内
|
||||
roadCacheMap.put(id, roadCache);
|
||||
Log.i("timer-matchRoad-3", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
// Logger.i("timer-matchRoad-3", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
return matchedPoint;
|
||||
// Log.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: "+roadCache.getLastLat());
|
||||
// Logger.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: "+roadCache.getLastLat());
|
||||
} else if (matchedPoint[2] > matchThreshold && matchedPoint[2] < 1.5) {
|
||||
// 目标车在阈值范围外,也就是说距离道路中心线太远了,就不吸附了
|
||||
return null;
|
||||
} else {
|
||||
// 目标车到道路中心线的映射点不在道路上,也就是已经使出了缓存的那条道路,需要重新获取一条道路,用useCache这个参数来避免重复递归
|
||||
roadCacheMap.put(id, noCache);
|
||||
Log.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + roadCache.getLastLat());
|
||||
// Logger.i("timer-matchRoad-2", "cost " + (System.currentTimeMillis() - start) + "ms roadId: " + roadCache.getLastLat());
|
||||
if (usdCache) {
|
||||
return matchRoad(id, lon, lat, angle, isGpsLocation, isRTK, false);
|
||||
} else {
|
||||
|
||||
@@ -264,6 +264,14 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMarkerAssInfo() {
|
||||
if ( mMarker != null ) {
|
||||
return mMarker.getMarkeOptions().getAssInfo();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnMarkerClickListener( IMogoMarkerClickListener listener ) {
|
||||
mMogoMarkerClickListener = listener;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.map.impl.custom.marker;
|
||||
|
||||
import com.mogo.map.impl.custom.AMapMarkerClickHandler;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
|
||||
@@ -10,9 +11,16 @@ public class MarkerWrapperClickHelper {
|
||||
|
||||
private volatile static MarkerWrapperClickHelper markerWrapperClickHelper;
|
||||
|
||||
private Map<String, IMogoMarker> mogoMarkerMap = new HashMap<>();
|
||||
private final Map<String, IMogoMarker> mogoMarkerMap = new HashMap<>();
|
||||
|
||||
private MarkerWrapperClickHelper(){
|
||||
|
||||
}
|
||||
|
||||
public void setMogoMarkerMap(String id,IMogoMarker iMogoMarker){
|
||||
if(isStaticMarker(id)){
|
||||
return;
|
||||
}
|
||||
this.mogoMarkerMap.put(id,iMogoMarker);
|
||||
}
|
||||
|
||||
@@ -30,4 +38,8 @@ public class MarkerWrapperClickHelper {
|
||||
}
|
||||
return markerWrapperClickHelper;
|
||||
}
|
||||
|
||||
public boolean isStaticMarker(String id){
|
||||
return id.contains("traffic");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,6 +167,12 @@ public interface IMogoMarker {
|
||||
*/
|
||||
void showInfoWindow();
|
||||
|
||||
/**
|
||||
* Marker对象 AssInfo
|
||||
* @return marker对象assInfo
|
||||
*/
|
||||
String getMarkerAssInfo();
|
||||
|
||||
/**
|
||||
* 设置点击事件
|
||||
*
|
||||
|
||||
@@ -14,5 +14,16 @@ public interface IMogoMarkerClickListener {
|
||||
* @param marker
|
||||
* @return true - 事件已经处理完毕不继续往下传,否则继续往下传
|
||||
*/
|
||||
boolean onMarkerClicked( IMogoMarker marker );
|
||||
default boolean onMarkerClicked(IMogoMarker marker){
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* 地图上静态Marker点击事件传递
|
||||
* @param marker
|
||||
* @return true - 事件已经处理完毕不继续往下传,否则继续往下传
|
||||
*/
|
||||
default boolean onStaticMarkerClicked(IMogoMarker marker){
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.mogo.map.marker;
|
||||
|
||||
public class MarkerType {
|
||||
|
||||
public static final String MAP_STATIC = "mapStatic";
|
||||
public static final String MAP_STATIC_TRAFFIC = "trafficcamera";
|
||||
}
|
||||
@@ -383,6 +383,11 @@ public class MogoMarkerOptions extends Observable {
|
||||
return mAnchorColor;
|
||||
}
|
||||
|
||||
public MogoMarkerOptions setGps(boolean gps) {
|
||||
isGps = gps;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MogoMarkerOptions{" +
|
||||
|
||||
@@ -34,7 +34,7 @@ public class MogoMarkersHandler implements IMogoMarkerClickListener, IMogoMarker
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private Map< String, List< IMogoMarker > > mServicesMarkers = new ConcurrentHashMap<>();
|
||||
private final Map< String, List< IMogoMarker > > mServicesMarkers = new ConcurrentHashMap<>();
|
||||
|
||||
private MogoMarkersHandler() {
|
||||
}
|
||||
@@ -121,6 +121,14 @@ public class MogoMarkersHandler implements IMogoMarkerClickListener, IMogoMarker
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStaticMarkerClicked(IMogoMarker marker) {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.onStaticMarkerClicked( marker );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tag 需要保留的类型
|
||||
*/
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
*/
|
||||
public class MogoPolylineOptions {
|
||||
|
||||
private List< MogoLatLng > mPoints;
|
||||
private List<MogoLatLng> mPoints;
|
||||
private float mWidth = 10.0F;
|
||||
private int mColor = Color.BLACK;
|
||||
private float mZIndex = 0.0F;
|
||||
@@ -30,7 +30,8 @@ public class MogoPolylineOptions {
|
||||
private float mTransparency = 1.0F;
|
||||
private boolean mIsAboveMaskLayer = false;
|
||||
private boolean mIsPointsUpdated = false;
|
||||
private List< Integer > mColorValues;
|
||||
private boolean mGps = false;
|
||||
private List<Integer> mColorValues;
|
||||
|
||||
public MogoPolylineOptions() {
|
||||
this.mPoints = new ArrayList<>();
|
||||
@@ -42,9 +43,9 @@ public class MogoPolylineOptions {
|
||||
* @param points
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions points( List< MogoLatLng > points ) {
|
||||
public MogoPolylineOptions points(List<MogoLatLng> points) {
|
||||
this.mPoints.clear();
|
||||
this.mPoints.addAll( points );
|
||||
this.mPoints.addAll(points);
|
||||
this.mIsPointsUpdated = true;
|
||||
return this;
|
||||
}
|
||||
@@ -55,22 +56,22 @@ public class MogoPolylineOptions {
|
||||
* @param points
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions add( MogoLatLng... points ) {
|
||||
if ( points != null ) {
|
||||
this.mPoints.addAll( Arrays.asList( points ) );
|
||||
public MogoPolylineOptions add(MogoLatLng... points) {
|
||||
if (points != null) {
|
||||
this.mPoints.addAll(Arrays.asList(points));
|
||||
this.mIsPointsUpdated = true;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public MogoPolylineOptions add( double lon, double lat ) {
|
||||
this.mPoints.add( new MogoLatLng( lat, lon ) );
|
||||
public MogoPolylineOptions add(double lon, double lat) {
|
||||
this.mPoints.add(new MogoLatLng(lat, lon));
|
||||
return this;
|
||||
}
|
||||
|
||||
public MogoPolylineOptions add( MogoLocation location ) {
|
||||
if ( location != null ) {
|
||||
this.mPoints.add( new MogoLatLng( location.getLatitude(), location.getLongitude() ) );
|
||||
public MogoPolylineOptions add(MogoLocation location) {
|
||||
if (location != null) {
|
||||
this.mPoints.add(new MogoLatLng(location.getLatitude(), location.getLongitude()));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -78,7 +79,7 @@ public class MogoPolylineOptions {
|
||||
/**
|
||||
* 设置线宽
|
||||
*/
|
||||
public MogoPolylineOptions width( float width ) {
|
||||
public MogoPolylineOptions width(float width) {
|
||||
this.mWidth = width;
|
||||
return this;
|
||||
}
|
||||
@@ -89,7 +90,7 @@ public class MogoPolylineOptions {
|
||||
* @param color
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions color( @ColorInt int color ) {
|
||||
public MogoPolylineOptions color(@ColorInt int color) {
|
||||
this.mColor = color;
|
||||
return this;
|
||||
}
|
||||
@@ -100,7 +101,7 @@ public class MogoPolylineOptions {
|
||||
* @param zIndex
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions zIndex( float zIndex ) {
|
||||
public MogoPolylineOptions zIndex(float zIndex) {
|
||||
this.mZIndex = zIndex;
|
||||
return this;
|
||||
}
|
||||
@@ -111,7 +112,7 @@ public class MogoPolylineOptions {
|
||||
* @param isVisible
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions visible( boolean isVisible ) {
|
||||
public MogoPolylineOptions visible(boolean isVisible) {
|
||||
this.mIsVisible = isVisible;
|
||||
return this;
|
||||
}
|
||||
@@ -122,7 +123,7 @@ public class MogoPolylineOptions {
|
||||
* @param isGeodesic
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions geodesic( boolean isGeodesic ) {
|
||||
public MogoPolylineOptions geodesic(boolean isGeodesic) {
|
||||
this.mIsGeodesic = isGeodesic;
|
||||
return this;
|
||||
}
|
||||
@@ -133,7 +134,7 @@ public class MogoPolylineOptions {
|
||||
* @param isDottedLine
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions dottedLine( boolean isDottedLine ) {
|
||||
public MogoPolylineOptions dottedLine(boolean isDottedLine) {
|
||||
this.mIsDottedLine = isDottedLine;
|
||||
return this;
|
||||
}
|
||||
@@ -144,7 +145,7 @@ public class MogoPolylineOptions {
|
||||
* @param isGradient
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions useGradient( boolean isGradient ) {
|
||||
public MogoPolylineOptions useGradient(boolean isGradient) {
|
||||
this.mIsGradient = isGradient;
|
||||
return this;
|
||||
}
|
||||
@@ -155,7 +156,7 @@ public class MogoPolylineOptions {
|
||||
* @param transparency
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions transparency( float transparency ) {
|
||||
public MogoPolylineOptions transparency(float transparency) {
|
||||
this.mTransparency = transparency;
|
||||
return this;
|
||||
}
|
||||
@@ -164,7 +165,7 @@ public class MogoPolylineOptions {
|
||||
* @param isAboveMaskLayer
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions aboveMaskLayer( boolean isAboveMaskLayer ) {
|
||||
public MogoPolylineOptions aboveMaskLayer(boolean isAboveMaskLayer) {
|
||||
this.mIsAboveMaskLayer = isAboveMaskLayer;
|
||||
return this;
|
||||
}
|
||||
@@ -173,12 +174,20 @@ public class MogoPolylineOptions {
|
||||
* @param colors
|
||||
* @return
|
||||
*/
|
||||
public MogoPolylineOptions colorValues( List< Integer > colors ) {
|
||||
public MogoPolylineOptions colorValues(List<Integer> colors) {
|
||||
mColorValues = colors;
|
||||
return this;
|
||||
}
|
||||
public boolean gps() {
|
||||
return mGps;
|
||||
}
|
||||
|
||||
public List< MogoLatLng > getPoints() {
|
||||
public MogoPolylineOptions setGps(boolean gps) {
|
||||
mGps = gps;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MogoLatLng> getPoints() {
|
||||
return mPoints;
|
||||
}
|
||||
|
||||
@@ -222,7 +231,7 @@ public class MogoPolylineOptions {
|
||||
return mIsPointsUpdated;
|
||||
}
|
||||
|
||||
public List< Integer > getColorValues() {
|
||||
public List<Integer> getColorValues() {
|
||||
return mColorValues;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import static com.mogo.module.common.entity.V2XMessageEntity.V2XTypeEnum.ALERT_T
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class MainLauncherActivity extends MainActivity implements IMogoIntentListener, IMogoStatusChangedListener, IV2XListener {
|
||||
public class MainLauncherActivity extends MainActivity implements IMogoIntentListener, IV2XListener {
|
||||
private static final String TAG = "MainLauncherActivity";
|
||||
protected boolean mIsHomeKeyDown = false;
|
||||
private static Handler handlerV2XEvent = new Handler();
|
||||
@@ -53,9 +53,6 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
DebugConfig.setNeedRequestUserInfo(true);
|
||||
Log.d(TAG, "onCreate");
|
||||
mServiceApis.getV2XListenerManager().registerIntentListener(MogoReceiver.ACTION_V2X_FRONT_WARNING, this);
|
||||
mServiceApis.getStatusManagerApi().registerStatusChangedListener(TAG,
|
||||
StatusDescriptor.VR_MODE, this);
|
||||
DisplayEffectsHelper.getInstance().init(clSpecialEffect);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -164,28 +161,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
Logger.d(TAG, "send msg to AI Voice");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
FrameLayout.LayoutParams entranceParams = ((FrameLayout.LayoutParams) mEntrance.getLayoutParams());
|
||||
if (isTrue) {
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize(R.dimen.module_main_entrance_fragment_container_marginLeft_in_vr_mode);
|
||||
mLeftShadowFrame.setVisibility(View.GONE);
|
||||
mApps.setVisibility(View.GONE);
|
||||
} else {
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize(R.dimen.module_main_id_entrance_fragment_container_marginLeft);
|
||||
mLeftShadowFrame.setVisibility(View.VISIBLE);
|
||||
mApps.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mEntrance.setLayoutParams(entranceParams);
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (isTrue) {
|
||||
clSpecialEffect.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
clSpecialEffect.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void warningChangedWithDirection(int type) {
|
||||
@@ -252,4 +228,15 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis
|
||||
EXPIRE_TIMER = ALL_EXPIRE_TIMER;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
if (isTrue) {
|
||||
mLeftShadowFrame.setVisibility(View.GONE);
|
||||
mApps.setVisibility(View.GONE);
|
||||
} else {
|
||||
mLeftShadowFrame.setVisibility(View.VISIBLE);
|
||||
mApps.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
recognizedListResult.lat = matchLonLat[1];
|
||||
|
||||
mLastPositions.put( uniqueKey, recognizedListResult );
|
||||
Logger.d( "matchRoad", "cost = %s", System.currentTimeMillis() - start );
|
||||
// Logger.d( "matchRoad", "cost = %s", System.currentTimeMillis() - start );
|
||||
|
||||
newAdasRecognizedMarkersCaches.put( uniqueKey, marker );
|
||||
if ( lastPosition != null ) {
|
||||
|
||||
@@ -9,7 +9,10 @@ import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.IMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.MapMarker3DResAdapter;
|
||||
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
|
||||
import com.mogo.module.common.drawer.marker.OnlineCarMarkerView;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
@@ -41,9 +44,9 @@ class MarkerDrawer {
|
||||
}
|
||||
|
||||
public static MarkerDrawer getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MarkerDrawer.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (MarkerDrawer.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MarkerDrawer();
|
||||
}
|
||||
}
|
||||
@@ -60,46 +63,61 @@ class MarkerDrawer {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity, int zIndex, IMogoMarkerClickListener listener ) {
|
||||
return drawMapMarkerImpl( markerShowEntity, false, zIndex, 0, listener );
|
||||
public IMogoMarker drawMapMarkerImpl(MarkerShowEntity markerShowEntity, int zIndex, IMogoMarkerClickListener listener) {
|
||||
return drawMapMarkerImpl(markerShowEntity, false, zIndex, 0, listener);
|
||||
}
|
||||
|
||||
public IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity, boolean matchRoadSide, int zIndex, IMogoMarkerClickListener listener ) {
|
||||
return drawMapMarkerImpl( markerShowEntity, matchRoadSide, zIndex, 0, listener );
|
||||
public IMogoMarker drawMapMarkerImpl(MarkerShowEntity markerShowEntity, boolean matchRoadSide, int zIndex, IMogoMarkerClickListener listener) {
|
||||
return drawMapMarkerImpl(markerShowEntity, matchRoadSide, zIndex, 0, listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* add marker, {@link OnlineCarDrawer 如果是需要在3D模式下显示,则需要设置 {@link MogoMarkerOptions icon3DRes 资源id}}
|
||||
*
|
||||
* @param markerShowEntity marker展示数据结构体
|
||||
* @param matchRoadSide 设置是否道路吸附,暂时没用到这个字段
|
||||
* @param zIndex zOrder
|
||||
* @param icon3DRes 3D Res资源
|
||||
* @param listener marker回调
|
||||
* @param matchRoadSide 设置是否道路吸附,暂时没用到这个字段
|
||||
* @param zIndex zOrder
|
||||
* @param icon3DRes 3D Res资源
|
||||
* @param listener marker回调
|
||||
* @return {@link IMogoMarker}
|
||||
*/
|
||||
public IMogoMarker drawMapMarkerImpl( MarkerShowEntity markerShowEntity, boolean matchRoadSide, int zIndex, int icon3DRes, IMogoMarkerClickListener listener ) {
|
||||
if ( markerShowEntity == null || markerShowEntity.getMarkerLocation() == null ) {
|
||||
public IMogoMarker drawMapMarkerImpl(MarkerShowEntity markerShowEntity, boolean matchRoadSide, int zIndex, int icon3DRes, IMogoMarkerClickListener listener) {
|
||||
if (markerShowEntity == null || markerShowEntity.getMarkerLocation() == null) {
|
||||
return null;
|
||||
}
|
||||
MogoMarkerOptions options = new MogoMarkerOptions().icon3DRes( icon3DRes ).set3DMode(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()).matchOnRoadSide( matchRoadSide ).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 {
|
||||
options.icon( markerView.getBitmap( ( ( MarkerOnlineCar ) markerShowEntity.getBindObj() ).getCarInfo().getVehicleType() ) );
|
||||
} catch ( Exception e ) {
|
||||
options.icon( markerView.getBitmap( 0 ) );
|
||||
MogoMarkerOptions options = new MogoMarkerOptions().icon3DRes(icon3DRes).set3DMode(MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()).matchOnRoadSide(matchRoadSide).owner(markerShowEntity.getMarkerType()).zIndex(zIndex).object(markerShowEntity).latitude(markerShowEntity.getMarkerLocation().getLat()).longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
if (bindObj instanceof MarkerExploreWay && ((MarkerExploreWay) bindObj).getPoiType() != null) {
|
||||
String poiType = ((MarkerExploreWay) bindObj).getPoiType();
|
||||
options.icon3DRes(MapMarker3DResAdapter.getMarker3DRes(poiType));
|
||||
}
|
||||
options.anchor( 0.5f, 0.5f );
|
||||
|
||||
}
|
||||
IMarkerView markerView = MapMarkerAdapter.getMarkerView(AbsMogoApplication.getApp(), markerShowEntity, options);
|
||||
if (markerView instanceof OnlineCarMarkerView) {
|
||||
try {
|
||||
options.icon(markerView.getBitmap(((MarkerOnlineCar) markerShowEntity.getBindObj()).getCarInfo().getVehicleType()));
|
||||
} catch (Exception e) {
|
||||
options.icon(markerView.getBitmap(0));
|
||||
}
|
||||
options.anchor(0.5f, 0.5f);
|
||||
} else {
|
||||
options.icon( markerView.getView() );
|
||||
options.icon(markerView.getView());
|
||||
}
|
||||
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( AbsMogoApplication.getApp() ).addMarker( markerShowEntity.getMarkerType(), options );
|
||||
if ( marker != null ) {
|
||||
marker.setOwner( markerShowEntity.getMarkerType() );
|
||||
markerView.setMarker( marker );
|
||||
marker.setOnMarkerClickListener( listener );
|
||||
markerShowEntity.setMarker( marker );
|
||||
if (options.getIcon3DRes() != 0) {
|
||||
options.icon(new EmptyMarkerView(AbsMogoApplication.getApp()));
|
||||
options.icon(markerView.getBitmap(0));
|
||||
}
|
||||
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
if (marker != null) {
|
||||
marker.setOwner(markerShowEntity.getMarkerType());
|
||||
markerView.setMarker(marker);
|
||||
marker.setOnMarkerClickListener(listener);
|
||||
markerShowEntity.setMarker(marker);
|
||||
}
|
||||
return marker;
|
||||
}
|
||||
@@ -111,42 +129,42 @@ class MarkerDrawer {
|
||||
* @param newList
|
||||
* @return
|
||||
*/
|
||||
public Map< String, IMogoMarker > purgeMarkerData( List newList, String markerType ) {
|
||||
public Map<String, IMogoMarker> purgeMarkerData(List newList, String markerType) {
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
Map< String, IMogoMarker > existMap = new HashMap<>();
|
||||
List< IMogoMarker > allCarsList = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( AbsMogoApplication.getApp() ).getMarkers( markerType );
|
||||
if ( allCarsList == null || allCarsList.isEmpty() ) {
|
||||
Map<String, IMogoMarker> existMap = new HashMap<>();
|
||||
List<IMogoMarker> allCarsList = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(AbsMogoApplication.getApp()).getMarkers(markerType);
|
||||
if (allCarsList == null || allCarsList.isEmpty()) {
|
||||
return existMap;
|
||||
}
|
||||
if ( newList == null || newList.isEmpty() ) {
|
||||
if (newList == null || newList.isEmpty()) {
|
||||
return existMap;
|
||||
}
|
||||
|
||||
Map< String, IMogoMarker > allMap = new HashMap<>();
|
||||
for ( IMogoMarker marker : allCarsList ) {
|
||||
String sn = getPrimaryKeyFromMarker( marker );
|
||||
allMap.put( sn, marker );
|
||||
Map<String, IMogoMarker> allMap = new HashMap<>();
|
||||
for (IMogoMarker marker : allCarsList) {
|
||||
String sn = getPrimaryKeyFromMarker(marker);
|
||||
allMap.put(sn, marker);
|
||||
}
|
||||
for ( Object entity : newList ) {
|
||||
String sn = getPrimaryKeyFromEntity( entity );
|
||||
if ( allMap.containsKey( sn ) ) {
|
||||
if ( !isNewVehicleType( entity, allMap.get( sn ) ) ) {
|
||||
existMap.put( sn, allMap.get( sn ) );
|
||||
for (Object entity : newList) {
|
||||
String sn = getPrimaryKeyFromEntity(entity);
|
||||
if (allMap.containsKey(sn)) {
|
||||
if (!isNewVehicleType(entity, allMap.get(sn))) {
|
||||
existMap.put(sn, allMap.get(sn));
|
||||
}
|
||||
}
|
||||
}
|
||||
for ( String sn : allMap.keySet() ) {
|
||||
if ( !existMap.containsKey( sn ) ) {
|
||||
IMogoMarker dirtyMarker = allMap.get( sn );
|
||||
allCarsList.remove( dirtyMarker );
|
||||
if ( dirtyMarker != null ) {
|
||||
for (String sn : allMap.keySet()) {
|
||||
if (!existMap.containsKey(sn)) {
|
||||
IMogoMarker dirtyMarker = allMap.get(sn);
|
||||
allCarsList.remove(dirtyMarker);
|
||||
if (dirtyMarker != null) {
|
||||
dirtyMarker.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
allMap.clear();
|
||||
Logger.i( "timer", "purge data cost " + ( System.currentTimeMillis() - start ) + "ms" );
|
||||
Logger.i("timer", "purge data cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
return existMap;
|
||||
}
|
||||
|
||||
@@ -156,74 +174,74 @@ class MarkerDrawer {
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public int getAppropriateSize( int maxAmount, List list ) {
|
||||
if ( list == null ) {
|
||||
public int getAppropriateSize(int maxAmount, List list) {
|
||||
if (list == null) {
|
||||
return 0;
|
||||
}
|
||||
return Math.min( maxAmount, list.size() );
|
||||
return Math.min(maxAmount, list.size());
|
||||
}
|
||||
|
||||
|
||||
private boolean isNewVehicleType( Object object, IMogoMarker marker ) {
|
||||
if ( object instanceof MarkerOnlineCar
|
||||
private boolean isNewVehicleType(Object object, IMogoMarker marker) {
|
||||
if (object instanceof MarkerOnlineCar
|
||||
&& marker != null
|
||||
&& marker.getObject() instanceof MarkerShowEntity
|
||||
&& ( ( MarkerShowEntity ) marker.getObject() ).getBindObj() instanceof MarkerOnlineCar ) {
|
||||
&& ((MarkerShowEntity) marker.getObject()).getBindObj() instanceof MarkerOnlineCar) {
|
||||
try {
|
||||
return ( ( MarkerOnlineCar ) object ).getCarInfo().getVehicleType()
|
||||
!= ( ( MarkerOnlineCar ) ( ( MarkerShowEntity ) marker.getObject() ).getBindObj() ).getCarInfo().getVehicleType();
|
||||
} catch ( Exception e ) {
|
||||
return ((MarkerOnlineCar) object).getCarInfo().getVehicleType()
|
||||
!= ((MarkerOnlineCar) ((MarkerShowEntity) marker.getObject()).getBindObj()).getCarInfo().getVehicleType();
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getPrimaryKeyFromEntity( Object entity ) {
|
||||
if ( entity instanceof MarkerExploreWay ) {
|
||||
String id = ( ( MarkerExploreWay ) entity ).getInfoId();
|
||||
if ( !TextUtils.isEmpty( id ) ) {
|
||||
public String getPrimaryKeyFromEntity(Object entity) {
|
||||
if (entity instanceof MarkerExploreWay) {
|
||||
String id = ((MarkerExploreWay) entity).getInfoId();
|
||||
if (!TextUtils.isEmpty(id)) {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
return getCarSnFromEntity( entity );
|
||||
return getCarSnFromEntity(entity);
|
||||
}
|
||||
|
||||
private String getPrimaryKeyFromMarker( IMogoMarker marker ) {
|
||||
if ( marker == null || marker.getObject() == null || marker.isDestroyed() ) {
|
||||
private String getPrimaryKeyFromMarker(IMogoMarker marker) {
|
||||
if (marker == null || marker.getObject() == null || marker.isDestroyed()) {
|
||||
return null;
|
||||
}
|
||||
if ( !( marker.getObject() instanceof MarkerShowEntity ) ) {
|
||||
if (!(marker.getObject() instanceof MarkerShowEntity)) {
|
||||
return null;
|
||||
}
|
||||
return getPrimaryKeyFromEntity( ( ( MarkerShowEntity ) marker.getObject() ).getBindObj() );
|
||||
return getPrimaryKeyFromEntity(((MarkerShowEntity) marker.getObject()).getBindObj());
|
||||
}
|
||||
|
||||
private String getCarSnFromEntity( Object entity ) {
|
||||
private String getCarSnFromEntity(Object entity) {
|
||||
try {
|
||||
if ( entity instanceof MarkerOnlineCar ) {
|
||||
return ( ( MarkerOnlineCar ) entity ).getUserInfo().getSn();
|
||||
} else if ( entity instanceof MarkerShareMusic ) {
|
||||
return ( ( MarkerShareMusic ) entity ).getUserInfo().getSn();
|
||||
} else if ( entity instanceof MarkerNoveltyInfo ) {
|
||||
return ( ( MarkerNoveltyInfo ) entity ).getSn();
|
||||
} else if ( entity instanceof MarkerExploreWay ) {
|
||||
return ( ( MarkerExploreWay ) entity ).getUserInfo().getSn();
|
||||
if (entity instanceof MarkerOnlineCar) {
|
||||
return ((MarkerOnlineCar) entity).getUserInfo().getSn();
|
||||
} else if (entity instanceof MarkerShareMusic) {
|
||||
return ((MarkerShareMusic) entity).getUserInfo().getSn();
|
||||
} else if (entity instanceof MarkerNoveltyInfo) {
|
||||
return ((MarkerNoveltyInfo) entity).getSn();
|
||||
} else if (entity instanceof MarkerExploreWay) {
|
||||
return ((MarkerExploreWay) entity).getUserInfo().getSn();
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getCarSnFromMarker( IMogoMarker marker ) {
|
||||
if ( marker == null || marker.getObject() == null || marker.isDestroyed() ) {
|
||||
public String getCarSnFromMarker(IMogoMarker marker) {
|
||||
if (marker == null || marker.getObject() == null || marker.isDestroyed()) {
|
||||
return null;
|
||||
}
|
||||
if ( !( marker.getObject() instanceof MarkerShowEntity ) ) {
|
||||
if (!(marker.getObject() instanceof MarkerShowEntity)) {
|
||||
return null;
|
||||
}
|
||||
return getCarSnFromEntity( ( ( MarkerShowEntity ) marker.getObject() ).getBindObj() );
|
||||
return getCarSnFromEntity(((MarkerShowEntity) marker.getObject()).getBindObj());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,9 +251,9 @@ class MarkerDrawer {
|
||||
* @param point2 点二坐标
|
||||
* @return 两坐标的距离 单位:米(M)
|
||||
*/
|
||||
public static float calculateLineDistance( MogoLatLng point1, MogoLatLng point2 ) {
|
||||
if ( point1 != null && point2 != null ) {
|
||||
return calculateLineDistance( point1.lon, point1.lat, point2.lon, point2.lat );
|
||||
public static float calculateLineDistance(MogoLatLng point1, MogoLatLng point2) {
|
||||
if (point1 != null && point2 != null) {
|
||||
return calculateLineDistance(point1.lon, point1.lat, point2.lon, point2.lat);
|
||||
} else {
|
||||
return 0.0F;
|
||||
}
|
||||
@@ -248,7 +266,7 @@ class MarkerDrawer {
|
||||
* @param lat2
|
||||
* @return 两坐标的距离 单位:米(M)
|
||||
*/
|
||||
public static float calculateLineDistance( double lon1, double lat1, double lon2, double lat2 ) {
|
||||
return CoordinateUtils.calculateLineDistance( lon1, lat1, lon2, lat2 );
|
||||
public static float calculateLineDistance(double lon1, double lat1, double lon2, double lat2) {
|
||||
return CoordinateUtils.calculateLineDistance(lon1, lat1, lon2, lat2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,8 +87,8 @@ class RoadConditionDrawer {
|
||||
try {
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
mogoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl( markerShowEntity, true, MarkerDrawer.MARKER_Z_INDEX_HIGH, listener );
|
||||
mogoMarker.setInfoWindowAdapter( new RoadConditionInfoWindow3DAdapter( markerShowEntity, AbsMogoApplication.getApp(), mogoMarker.getMogoMarkerOptions() ) );
|
||||
mogoMarker.showInfoWindow();
|
||||
// mogoMarker.setInfoWindowAdapter( new RoadConditionInfoWindow3DAdapter( markerShowEntity, AbsMogoApplication.getApp(), mogoMarker.getMogoMarkerOptions() ) );
|
||||
// mogoMarker.showInfoWindow();
|
||||
} else {
|
||||
if ( DebugConfig.isRoadEventAnimated() ) {
|
||||
post2AddAndStartAnimation( markerShowEntity, i * 100L, listener );
|
||||
|
||||
@@ -95,7 +95,6 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
MogoLatLng newLocation = Trigonometric.getNewLocation(mogoLatLng, 5, 180);
|
||||
|
||||
IMogoMarker marker = drawMarker(markerShowEntity, modeResType(data.getType()));
|
||||
Log.d("liyz", "renderWarnData marker != null direction = " + data.getDirection());
|
||||
//识别物
|
||||
marker.addDynamicAnchorPosition(new MogoLatLng(
|
||||
data.getDirection() == 1 ? data.getStopLines().get(1).lat : data.getCollisionLat(),
|
||||
@@ -134,10 +133,10 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(markerShowEntity)
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon())
|
||||
.setGps(true);
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(getModelRes(modeResType)); //TODO
|
||||
|
||||
options.anchorColor("#FB3C3CFF"); //红色#FF3036 蓝色:#256BFF
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
@@ -151,6 +150,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
.latitude(location.getLat())
|
||||
.longitude(location.getLon())
|
||||
.set3DMode(true)
|
||||
.setGps(true)
|
||||
.controlAngle(true)
|
||||
.icon3DRes(getModelRes(type))
|
||||
.anchorColor("#FB3C3CFF")
|
||||
@@ -169,6 +169,7 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
.latitude(newLocation.getLat())
|
||||
.longitude(newLocation.getLon())
|
||||
.anchor(1.0f, 1.0f)
|
||||
.setGps(true)
|
||||
.zIndex(MarkerDrawer.MARKER_Z_INDEX_HIGH);
|
||||
optionsRipple
|
||||
.icon(ViewUtils.fromView(new EmptyMarkerView(mContext)));
|
||||
@@ -209,10 +210,10 @@ public class V2XWarnDataDrawer extends BaseDrawer implements IMogoStatusChangedL
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.object(markerShowEntity)
|
||||
.latitude(markerShowEntity.getMarkerLocation().getLat())
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon());
|
||||
.longitude(markerShowEntity.getMarkerLocation().getLon())
|
||||
.setGps(true);
|
||||
IMarkerView iMarkerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
|
||||
options.icon3DRes(getModelRes(9));
|
||||
|
||||
options.anchorColor("#FB3C3CFF");
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(markerShowEntity.getMarkerType(), options);
|
||||
iMarkerView.setMarker(marker);
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.mogo.module.common.drawer.marker;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
|
||||
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ACCIDENT;
|
||||
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_BLOCK_UP;
|
||||
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_FOG;
|
||||
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ICE;
|
||||
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_LIVING;
|
||||
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_PONDING;
|
||||
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.FOURS_ROAD_WORK;
|
||||
import static com.mogo.module.common.entity.MarkerPoiTypeEnum.TRAFFIC_CHECK;
|
||||
|
||||
/**
|
||||
* created by wujifei on 2021/4/28 18:04
|
||||
* describe:地图Marker的3d资源适配器
|
||||
*/
|
||||
public class MapMarker3DResAdapter {
|
||||
|
||||
public static int getMarker3DRes(String poiType) {
|
||||
int res = 0;
|
||||
switch (poiType) {
|
||||
case FOURS_BLOCK_UP:
|
||||
res = R.raw.v2x_yongdu;
|
||||
break;
|
||||
case FOURS_ACCIDENT:
|
||||
res = R.raw.v2x_shigu;
|
||||
break;
|
||||
case FOURS_LIVING:
|
||||
res = R.raw.v2x_shishilukuang;
|
||||
break;
|
||||
case FOURS_FOG:
|
||||
res = R.raw.v2x_nongwu;
|
||||
break;
|
||||
case TRAFFIC_CHECK:
|
||||
res = R.raw.v2x_jiaotongjiancha;
|
||||
break;
|
||||
case FOURS_ROAD_WORK:
|
||||
res = R.raw.v2x_daolushigong;
|
||||
break;
|
||||
case FOURS_ICE:
|
||||
res = R.raw.v2x_daolujiebing;
|
||||
break;
|
||||
case FOURS_PONDING:
|
||||
res = R.raw.v2x_daolujishui;
|
||||
break;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
BIN
modules/mogo-module-common/src/main/res/raw/v2x_daolujiebing.n3d
Normal file
BIN
modules/mogo-module-common/src/main/res/raw/v2x_daolujiebing.n3d
Normal file
Binary file not shown.
BIN
modules/mogo-module-common/src/main/res/raw/v2x_daolujishui.n3d
Normal file
BIN
modules/mogo-module-common/src/main/res/raw/v2x_daolujishui.n3d
Normal file
Binary file not shown.
BIN
modules/mogo-module-common/src/main/res/raw/v2x_daolushigong.n3d
Normal file
BIN
modules/mogo-module-common/src/main/res/raw/v2x_daolushigong.n3d
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
modules/mogo-module-common/src/main/res/raw/v2x_nongwu.n3d
Normal file
BIN
modules/mogo-module-common/src/main/res/raw/v2x_nongwu.n3d
Normal file
Binary file not shown.
BIN
modules/mogo-module-common/src/main/res/raw/v2x_shigu.n3d
Normal file
BIN
modules/mogo-module-common/src/main/res/raw/v2x_shigu.n3d
Normal file
Binary file not shown.
Binary file not shown.
BIN
modules/mogo-module-common/src/main/res/raw/v2x_yongdu.n3d
Normal file
BIN
modules/mogo-module-common/src/main/res/raw/v2x_yongdu.n3d
Normal file
Binary file not shown.
@@ -8,6 +8,7 @@ import android.util.Log;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.extensions.R;
|
||||
@@ -40,16 +41,18 @@ public class CameraLiveNoticeHelper implements IMogoCloudOnMsgListener {
|
||||
mContext = context;
|
||||
|
||||
MoGoAiCloudRealTime.registerOnMsgListener(this);
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerMogoMarkerClickListener(PushDataType.TYPE_PUSH_CAMERA_DATA, marker -> {
|
||||
//点击的marker的具体数据
|
||||
if (mCloudRoadData != null && !TextUtils.isEmpty(mCloudRoadData.getRtmpUrl())) {
|
||||
CameraLiveManager.getInstance().init(mCloudRoadData);
|
||||
} else {
|
||||
Logger.e(TAG, " onMarkerClicked mCloudRoadData == null ");
|
||||
TipToast.shortTip("直播流地址为空");
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerMogoMarkerClickListener(PushDataType.TYPE_PUSH_CAMERA_DATA, new IMogoMarkerClickListener() {
|
||||
@Override
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
//点击的marker的具体数据
|
||||
if (mCloudRoadData != null && !TextUtils.isEmpty(mCloudRoadData.getRtmpUrl())) {
|
||||
CameraLiveManager.getInstance().init(mCloudRoadData);
|
||||
} else {
|
||||
Logger.e(TAG, " onMarkerClicked mCloudRoadData == null ");
|
||||
TipToast.shortTip("直播流地址为空");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// loadMarker(false);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.module.main;
|
||||
|
||||
import android.location.Location;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
@@ -20,7 +19,6 @@ import com.mogo.map.navi.MogoCongestionInfo;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.main.registercenter.MogoRegisterCenterHandler;
|
||||
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -28,6 +26,7 @@ import com.zhidao.adasconfig.common.config.EnumCarChatIncognitoMode;
|
||||
import com.zhidao.adasconfig.listener.IAdasSettingUIListener;
|
||||
import com.zhidao.adasconfig.listener.IAdasSkinStyleListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
@@ -80,6 +79,22 @@ public class EventDispatchCenter implements
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStaticMarkerClicked(IMogoMarker marker) {
|
||||
ArrayList<IMogoMarkerClickListener> list = MogoRegisterCenterHandler.getInstance().getStaticMarkerListener( marker.getOwner() );
|
||||
if(list == null){
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
for (IMogoMarkerClickListener listener : list) {
|
||||
return listener.onStaticMarkerClicked( marker );
|
||||
}
|
||||
} catch ( Exception e){
|
||||
Logger.e( TAG, e, "error." );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTraffic2( MogoTraffic traffic ) {
|
||||
Iterator< IMogoAimlessModeListener > iterator = MogoRegisterCenterHandler.getInstance().getAimlessModeListeners();
|
||||
|
||||
@@ -31,7 +31,9 @@ import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.service.v2x.IV2XListener;
|
||||
import com.mogo.skin.support.SkinMode;
|
||||
import com.mogo.utils.NetworkUtils;
|
||||
@@ -50,6 +52,7 @@ import java.util.List;
|
||||
*/
|
||||
public class MainActivity extends MvpActivity<MainView, MainPresenter> implements MainView,
|
||||
IMogoLocationListener,
|
||||
IMogoStatusChangedListener,
|
||||
IMogoADASControlStatusChangedListener,
|
||||
FragmentStackTransactionListener {
|
||||
|
||||
@@ -151,8 +154,9 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
super.onCreate(savedInstanceState);
|
||||
ContextHolderUtil.holdContext(this);
|
||||
mPresenter.postLoadModuleMsg();
|
||||
|
||||
NetworkUtils.listenNetStrength(this);
|
||||
DisplayEffectsHelper.getInstance().init(clSpecialEffect);
|
||||
mServiceApis.getStatusManagerApi().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, this);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
@@ -402,4 +406,23 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
mServiceApis.getShareManager().releaseContext();
|
||||
mServiceApis.getSkinSupportInstallerApi().onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
FrameLayout.LayoutParams entranceParams = ((FrameLayout.LayoutParams) mEntrance.getLayoutParams());
|
||||
if (isTrue) {
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize(R.dimen.module_main_entrance_fragment_container_marginLeft_in_vr_mode);
|
||||
} else {
|
||||
entranceParams.leftMargin = getResources().getDimensionPixelSize(R.dimen.module_main_id_entrance_fragment_container_marginLeft);
|
||||
}
|
||||
mEntrance.setLayoutParams(entranceParams);
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (isTrue) {
|
||||
clSpecialEffect.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
clSpecialEffect.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,100 +22,110 @@ import java.util.Iterator;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
@Route( path = MogoServicePaths.PATH_REGISTER_CENTER )
|
||||
@Route(path = MogoServicePaths.PATH_REGISTER_CENTER)
|
||||
public class MogoRegisterCenter implements IMogoRegisterCenter {
|
||||
|
||||
@Override
|
||||
public void registerMogoModuleLifecycle( String moduleName, IMogoModuleLifecycle lifecycle ) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoModuleLifecycle( moduleName, lifecycle );
|
||||
public void registerMogoModuleLifecycle(String moduleName, IMogoModuleLifecycle lifecycle) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoModuleLifecycle(moduleName, lifecycle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoModuleLifecycle( String moduleName ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoModuleLifecycle( moduleName );
|
||||
public void unregisterMogoModuleLifecycle(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoModuleLifecycle(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoMapListener( String moduleName, IMogoMapListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoMapListener( moduleName, listener );
|
||||
public void registerMogoMapListener(String moduleName, IMogoMapListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoMapListener(moduleName, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMapListener( String moduleName ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoMapListener( moduleName );
|
||||
public void unregisterMogoMapListener(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoMapListener(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoNaviListener( String moduleName, IMogoNaviListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoNaviListener( moduleName, listener );
|
||||
public void registerMogoNaviListener(String moduleName, IMogoNaviListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoNaviListener(moduleName, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoNaviListener( String moduleName ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoNaviListener( moduleName );
|
||||
public void unregisterMogoNaviListener(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoNaviListener(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoLocationListener( String moduleName, IMogoLocationListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoLocationListener( moduleName, listener );
|
||||
public void registerMogoLocationListener(String moduleName, IMogoLocationListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoLocationListener(moduleName, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator< IMogoLocationListener > getLocationListeners() {
|
||||
public Iterator<IMogoLocationListener> getLocationListeners() {
|
||||
return MogoRegisterCenterHandler.getInstance().getLocationListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoLocationListener( String moduleName ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoLocationListener( moduleName );
|
||||
public void unregisterMogoLocationListener(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoLocationListener(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoMarkerClickListener( String moduleName, IMogoMarkerClickListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoMarkerClickListener( moduleName, listener );
|
||||
public void registerMogoMarkerClickListener(String moduleName, IMogoMarkerClickListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoMarkerClickListener(moduleName, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMarkerClickListener( String moduleName ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoMarkerClickListener( moduleName );
|
||||
public void unregisterMogoMarkerClickListener(String moduleName) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoMarkerClickListener(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoAimlessModeListener( String tag, IMogoAimlessModeListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoAimlessModeListener( tag, listener );
|
||||
public void registerMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoStaticMarkerClickListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoAimlessModeListener( String tag ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoAimlessModeListener( tag );
|
||||
public void unregisterMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoStaticMarkerClickListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( String tag, IMogoCarLocationChangedListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().registerCarLocationChangedListener( tag, listener );
|
||||
public void registerMogoAimlessModeListener(String tag, IMogoAimlessModeListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerMogoAimlessModeListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterCarLocationChangedListener( String tag, IMogoCarLocationChangedListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterCarLocationChangedListener( tag, listener );
|
||||
public void unregisterMogoAimlessModeListener(String tag) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterMogoAimlessModeListener(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerADASControlStatusChangedListener( String tag, IMogoADASControlStatusChangedListener listener ) {
|
||||
MogoRegisterCenterHandler.getInstance().registerADASControlStatusChangedListener( tag, listener );
|
||||
public void registerCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerCarLocationChangedListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterADASControlStatusChangedListener( String tag ) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterADASControlStatusChangedListener( tag );
|
||||
public void unregisterCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterCarLocationChangedListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator< IMogoADASControlStatusChangedListener > getAdasControlStatusChangedListeners() {
|
||||
public void registerADASControlStatusChangedListener(String tag, IMogoADASControlStatusChangedListener listener) {
|
||||
MogoRegisterCenterHandler.getInstance().registerADASControlStatusChangedListener(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterADASControlStatusChangedListener(String tag) {
|
||||
MogoRegisterCenterHandler.getInstance().unregisterADASControlStatusChangedListener(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<IMogoADASControlStatusChangedListener> getAdasControlStatusChangedListeners() {
|
||||
return MogoRegisterCenterHandler.getInstance().getAdasControlStatusChangedListeners();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
public void init(Context context) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoRegisterCenter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
@@ -27,22 +28,23 @@ public class MogoRegisterCenterHandler implements IMogoRegisterCenter {
|
||||
|
||||
private static volatile MogoRegisterCenterHandler sInstance;
|
||||
|
||||
private Map< String, IMogoModuleLifecycle > mLifecycle = new HashMap<>();
|
||||
private Map< String, IMogoMapListener > mMap = new HashMap<>();
|
||||
private Map< String, IMogoNaviListener > mNavi = new ConcurrentHashMap<>();
|
||||
private Map< String, IMogoLocationListener > mLocation = new HashMap<>();
|
||||
private Map< String, IMogoMarkerClickListener > mMarker = new HashMap<>();
|
||||
private Map< String, IMogoAimlessModeListener > mAimless = new HashMap<>();
|
||||
private Map< String, IMogoCarLocationChangedListener > mCarLocations = new ConcurrentHashMap<>();
|
||||
private Map< String, IMogoADASControlStatusChangedListener > mADAS = new HashMap<>();
|
||||
private final Map<String, IMogoModuleLifecycle> mLifecycle = new HashMap<>();
|
||||
private final Map<String, IMogoMapListener> mMap = new HashMap<>();
|
||||
private final Map<String, IMogoNaviListener> mNavi = new ConcurrentHashMap<>();
|
||||
private final Map<String, IMogoLocationListener> mLocation = new HashMap<>();
|
||||
private final Map<String, IMogoMarkerClickListener> mMarker = new HashMap<>();
|
||||
private final Map<String, ArrayList<IMogoMarkerClickListener>> mStaticMarker = new HashMap<>();
|
||||
private final Map<String, IMogoAimlessModeListener> mAimless = new HashMap<>();
|
||||
private final Map<String, IMogoCarLocationChangedListener> mCarLocations = new ConcurrentHashMap<>();
|
||||
private final Map<String, IMogoADASControlStatusChangedListener> mADAS = new HashMap<>();
|
||||
|
||||
private MogoRegisterCenterHandler() {
|
||||
}
|
||||
|
||||
public static MogoRegisterCenterHandler getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MogoRegisterCenterHandler.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoRegisterCenterHandler.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoRegisterCenterHandler();
|
||||
}
|
||||
}
|
||||
@@ -56,141 +58,166 @@ public class MogoRegisterCenterHandler implements IMogoRegisterCenter {
|
||||
|
||||
|
||||
@Override
|
||||
public void registerMogoModuleLifecycle( String tag, IMogoModuleLifecycle lifecycle ) {
|
||||
mLifecycle.put( tag, lifecycle );
|
||||
public void registerMogoModuleLifecycle(String tag, IMogoModuleLifecycle lifecycle) {
|
||||
mLifecycle.put(tag, lifecycle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoModuleLifecycle( String tag ) {
|
||||
mLifecycle.remove( tag );
|
||||
public void unregisterMogoModuleLifecycle(String tag) {
|
||||
mLifecycle.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoMapListener( String tag, IMogoMapListener listener ) {
|
||||
mMap.put( tag, listener );
|
||||
public void registerMogoMapListener(String tag, IMogoMapListener listener) {
|
||||
mMap.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMapListener( String tag ) {
|
||||
mMap.remove( tag );
|
||||
public void unregisterMogoMapListener(String tag) {
|
||||
mMap.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoNaviListener( String tag, IMogoNaviListener listener ) {
|
||||
mNavi.put( tag, listener );
|
||||
public void registerMogoNaviListener(String tag, IMogoNaviListener listener) {
|
||||
mNavi.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoNaviListener( String tag ) {
|
||||
mNavi.remove( tag );
|
||||
public void unregisterMogoNaviListener(String tag) {
|
||||
mNavi.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoLocationListener( String tag, IMogoLocationListener listener ) {
|
||||
mLocation.put( tag, listener );
|
||||
public void registerMogoLocationListener(String tag, IMogoLocationListener listener) {
|
||||
mLocation.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoLocationListener( String tag ) {
|
||||
mLocation.remove( tag );
|
||||
public void unregisterMogoLocationListener(String tag) {
|
||||
mLocation.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoMarkerClickListener( String tag, IMogoMarkerClickListener listener ) {
|
||||
mMarker.put( tag, listener );
|
||||
public void registerMogoMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
mMarker.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoMarkerClickListener( String tag ) {
|
||||
mMarker.remove( tag );
|
||||
public void unregisterMogoMarkerClickListener(String tag) {
|
||||
mMarker.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMogoAimlessModeListener( String tag, IMogoAimlessModeListener listener ) {
|
||||
mAimless.put( tag, listener );
|
||||
public void registerMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
ArrayList<IMogoMarkerClickListener> list = mStaticMarker.get(tag);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
list.add(listener);
|
||||
mStaticMarker.put(tag, list);
|
||||
}
|
||||
list.add(listener);
|
||||
mStaticMarker.put(tag, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterMogoAimlessModeListener( String tag ) {
|
||||
mAimless.remove( tag );
|
||||
public void unregisterMogoStaticMarkerClickListener(String tag, IMogoMarkerClickListener listener) {
|
||||
ArrayList<IMogoMarkerClickListener> list = mStaticMarker.get(tag);
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
list.remove(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( String tag, IMogoCarLocationChangedListener listener ) {
|
||||
mCarLocations.put( tag, listener );
|
||||
public void registerMogoAimlessModeListener(String tag, IMogoAimlessModeListener listener) {
|
||||
mAimless.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterCarLocationChangedListener( String tag, IMogoCarLocationChangedListener listener ) {
|
||||
mCarLocations.remove( tag );
|
||||
public void unregisterMogoAimlessModeListener(String tag) {
|
||||
mAimless.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerADASControlStatusChangedListener( String tag, IMogoADASControlStatusChangedListener listener ) {
|
||||
mADAS.put( tag, listener );
|
||||
public void registerCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
mCarLocations.put(tag, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterADASControlStatusChangedListener( String tag ) {
|
||||
mADAS.remove( tag );
|
||||
public void unregisterCarLocationChangedListener(String tag, IMogoCarLocationChangedListener listener) {
|
||||
mCarLocations.remove(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
public void registerADASControlStatusChangedListener(String tag, IMogoADASControlStatusChangedListener listener) {
|
||||
mADAS.put(tag, listener);
|
||||
}
|
||||
|
||||
public IMogoModuleLifecycle getLifecycleListener( String tag ) {
|
||||
return mLifecycle.get( tag );
|
||||
@Override
|
||||
public void unregisterADASControlStatusChangedListener(String tag) {
|
||||
mADAS.remove(tag);
|
||||
}
|
||||
|
||||
public IMogoMapListener getMapListener( String tag ) {
|
||||
return mMap.get( tag );
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
}
|
||||
|
||||
public IMogoNaviListener getNaviListener( String tag ) {
|
||||
return mNavi.get( tag );
|
||||
public IMogoModuleLifecycle getLifecycleListener(String tag) {
|
||||
return mLifecycle.get(tag);
|
||||
}
|
||||
|
||||
public IMogoLocationListener getLocationListener( String tag ) {
|
||||
return mLocation.get( tag );
|
||||
public IMogoMapListener getMapListener(String tag) {
|
||||
return mMap.get(tag);
|
||||
}
|
||||
|
||||
public IMogoMarkerClickListener getMarkerListener( String tag ) {
|
||||
return mMarker.get( tag );
|
||||
public IMogoNaviListener getNaviListener(String tag) {
|
||||
return mNavi.get(tag);
|
||||
}
|
||||
|
||||
public Iterator< IMogoModuleLifecycle > getLifecycleListeners() {
|
||||
public IMogoLocationListener getLocationListener(String tag) {
|
||||
return mLocation.get(tag);
|
||||
}
|
||||
|
||||
public IMogoMarkerClickListener getMarkerListener(String tag) {
|
||||
return mMarker.get(tag);
|
||||
}
|
||||
|
||||
public ArrayList<IMogoMarkerClickListener> getStaticMarkerListener(String tag){
|
||||
return mStaticMarker.get(tag);
|
||||
}
|
||||
|
||||
public Iterator<IMogoModuleLifecycle> getLifecycleListeners() {
|
||||
return mLifecycle.values().iterator();
|
||||
}
|
||||
|
||||
public Iterator< IMogoMapListener > getMapListeners() {
|
||||
public Iterator<IMogoMapListener> getMapListeners() {
|
||||
return mMap.values().iterator();
|
||||
}
|
||||
|
||||
public Iterator< IMogoNaviListener > getNaviListeners() {
|
||||
public Iterator<IMogoNaviListener> getNaviListeners() {
|
||||
return mNavi.values().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator< IMogoLocationListener > getLocationListeners() {
|
||||
public Iterator<IMogoLocationListener> getLocationListeners() {
|
||||
return mLocation.values().iterator();
|
||||
}
|
||||
|
||||
public Iterator< IMogoMarkerClickListener > getMarkerListeners() {
|
||||
public Iterator<IMogoMarkerClickListener> getMarkerListeners() {
|
||||
return mMarker.values().iterator();
|
||||
}
|
||||
|
||||
public Iterator< IMogoAimlessModeListener > getAimlessModeListeners() {
|
||||
public Iterator<IMogoAimlessModeListener> getAimlessModeListeners() {
|
||||
return mAimless.values().iterator();
|
||||
}
|
||||
|
||||
|
||||
public Iterator< IMogoCarLocationChangedListener > getCarLocationChangedListener() {
|
||||
public Iterator<IMogoCarLocationChangedListener> getCarLocationChangedListener() {
|
||||
return mCarLocations.values().iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator< IMogoADASControlStatusChangedListener > getAdasControlStatusChangedListeners() {
|
||||
public Iterator<IMogoADASControlStatusChangedListener> getAdasControlStatusChangedListeners() {
|
||||
return mADAS.values().iterator();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">15px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">460px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">444px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_id_left_panel_fragment_container_width">350px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">10px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">16px</dimen>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">30px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">830px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">590px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">30px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">70px</dimen>
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">30px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">830px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">800px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">20px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">30px</dimen>
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<dimen name="module_main_header_fragment_container_marginTop">15px</dimen>
|
||||
<dimen name="module_main_header_fragment_container_marginLeft">460px</dimen>
|
||||
<dimen name="module_main_id_entrance_fragment_container_marginLeft">444px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_marginLeft_in_vr_mode" >0px</dimen>
|
||||
<dimen name="module_main_id_left_panel_fragment_container_width">350px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding">10px</dimen>
|
||||
<dimen name="module_main_entrance_fragment_container_padding_top">16px</dimen>
|
||||
|
||||
@@ -848,6 +848,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
Log.i("mock-timer-loc-map", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
SnapshotLocationController.getInstance().syncAdasLocationInfo(jo);
|
||||
Log.i("mock-timer-loc", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
Log.i("mock-timer-loc-info",jo.toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.zhidao.carchattingprovider.ICallChatResponse;
|
||||
|
||||
@@ -173,22 +174,18 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
// 绘制近景识别到的车辆
|
||||
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( resultList );
|
||||
|
||||
//添加自车的定位图标,碰撞只有一个预警,还需要和adas 联调,还需要改 liyz
|
||||
// ADASRecognizedResult result = null;
|
||||
// for (int i = 0; i < resultList.size(); i++) {
|
||||
// result = resultList.get(i);
|
||||
// if (result.type) { //找出可能碰撞的车
|
||||
// result = resultList.get(i);
|
||||
//添加自车的定位图标,碰撞只有一个预警,还需要和adas 联调,
|
||||
// for ( ADASRecognizedResult result : resultList) {
|
||||
// if (result.drawlevel == 3) { //找出可能碰撞的车
|
||||
// Logger.d("liyz", "result.drawlevel == 3 ------> ");
|
||||
//// 绘制他车的线,从列表中查出可能碰撞的车的经纬度(没有或者只有一个),然后预设20米的长度
|
||||
//// 绘制碰撞的他车指引线,需要实时给数据更新 TODO
|
||||
// drawLimberCollisionPolyline(result);
|
||||
// //通过这个传值到 AMapViewWrapper,根据数据更新自车的模型数据
|
||||
// MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().setAdasRecognizedResult(result);
|
||||
// }
|
||||
|
||||
//绘制他车的线,从列表中查出可能碰撞的车的经纬度(没有或者只有一个),然后预设20米的长度
|
||||
//绘制碰撞的他车指引线,需要实时给数据更新 TODO
|
||||
// drawLimberCollisionPolyline(result);
|
||||
// }
|
||||
|
||||
// //通过这个传值到 AMapViewWrapper,根据数据更新自车的模型数据 ADASRecognizedResult
|
||||
// MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().setAdasRecognizedResult(result);
|
||||
|
||||
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
@@ -276,25 +276,26 @@ public class V2XModuleProvider implements
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 响应违章停车的POI点击
|
||||
V2XServiceManager
|
||||
.getMogoRegisterCenter()
|
||||
.registerMogoMarkerClickListener(V2XConst.MODULE_NAME,
|
||||
marker -> {
|
||||
try {
|
||||
MarkerExploreWay markerExploreWay =
|
||||
(MarkerExploreWay) ((MarkerShowEntity) marker.getObject()).getBindObj();
|
||||
Logger.d(V2XConst.MODULE_NAME,
|
||||
"V2X===违章停车:onMarkerClicked=" + markerExploreWay);
|
||||
.registerMogoMarkerClickListener(V2XConst.MODULE_NAME, new IMogoMarkerClickListener() {
|
||||
@Override
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
try {
|
||||
MarkerExploreWay markerExploreWay =
|
||||
(MarkerExploreWay) ((MarkerShowEntity) marker.getObject()).getBindObj();
|
||||
Logger.d(V2XConst.MODULE_NAME,
|
||||
"V2X===违章停车:onMarkerClicked=" + markerExploreWay);
|
||||
|
||||
//直接展示弹窗
|
||||
V2XIllegalParkWindow parkScenario = new V2XIllegalParkWindow();
|
||||
parkScenario.show(markerExploreWay, false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
//直接展示弹窗
|
||||
V2XIllegalParkWindow parkScenario = new V2XIllegalParkWindow();
|
||||
parkScenario.show(markerExploreWay, false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
// 注册V2X场景Socket
|
||||
@@ -429,4 +430,9 @@ public class V2XModuleProvider implements
|
||||
public void onMapChanged(MogoLatLng latLng, float zoom, float tilt, float bearing) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,37 +4,14 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
|
||||
import com.mogo.module.common.drawer.MarkerDrawer;
|
||||
import com.mogo.module.common.drawer.marker.AheadCollisionView;
|
||||
import com.mogo.module.common.drawer.marker.AheadCollisionWindow3DAdapter;
|
||||
import com.mogo.module.common.drawer.marker.EmptyMarkerView;
|
||||
import com.mogo.module.common.drawer.marker.SimpleWindow3DAdapter;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||
import com.mogo.module.common.utils.Trigonometric;
|
||||
import com.mogo.module.common.view.MarkerBaseFloor;
|
||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.listener.V2XWarnMessageListener;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mogo.module.v2x.V2XServiceManager.getContext;
|
||||
|
||||
/**
|
||||
* desc : V2X报警事件管理,这里进行报警事件的分发处理,包括了adas数据
|
||||
@@ -83,7 +60,7 @@ public class V2XWaringManager {
|
||||
private void testData(String adasResult) {
|
||||
|
||||
try {
|
||||
int id = R.raw.scenario_warning_event_data;
|
||||
int id = R.raw.scenario_warning_event_data_right;
|
||||
switch (adasResult) {
|
||||
case "left":
|
||||
id = R.raw.scenario_warning_event_data_left;
|
||||
|
||||
@@ -37,7 +37,8 @@ public class MoGoStopPolylineManager implements IMoGoStopPolylineManager {
|
||||
}
|
||||
|
||||
// 连接线参数
|
||||
MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
MogoPolylineOptions options = new MogoPolylineOptions()
|
||||
.setGps(true);
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
colors.add(0x0DE32F46);
|
||||
colors.add(0xD9E32F46);
|
||||
|
||||
@@ -70,13 +70,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
|
||||
@Override
|
||||
public void analysisV2XCloundDataEvent(V2XWarningEntity cloundWarningInfo) {
|
||||
//测试数据
|
||||
MogoLatLng s = new MogoLatLng(26.88394048,112.5678959);
|
||||
MogoLatLng t = new MogoLatLng(26.88393912,112.5678793);
|
||||
Double b = Trigonometric.getAngle(s.lon,s.lat,t.lon,t.lat);
|
||||
|
||||
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
// if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
mCloundWarningInfo = cloundWarningInfo;
|
||||
showTime = mCloundWarningInfo.getShowTime();
|
||||
pointsBetween();
|
||||
@@ -137,6 +131,54 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
}, showTime);
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 自车为起点绘制(根据设计,前方行人/弱势交通参与者预警 getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP自车与停止线之间为蓝色预警;其他侧方预警自车与预碰撞点之间显示红色预警)
|
||||
*/
|
||||
private void drawSelfCarLine(double lon, double lat, float bearing) {
|
||||
if (!isSelfLineClear) {
|
||||
IMogoPolyline mogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
|
||||
if (mCloundWarningInfo != null) {
|
||||
MogoLatLng startLatlng = null;
|
||||
MogoLatLng endLatlng = null;
|
||||
MogoLatLng addMiddleLoc = null;
|
||||
|
||||
if (!isFirstLocation) {
|
||||
carLocation = getMogoLat(new MogoLatLng(lat, lon));
|
||||
isFirstLocation = true;
|
||||
}
|
||||
|
||||
endLatlng = new MogoLatLng(mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP ? middleLocationInStopLine.lat : mCloundWarningInfo.getCollisionLat(),
|
||||
mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP ? middleLocationInStopLine.lon : mCloundWarningInfo.getCollisionLon());
|
||||
//自车位置
|
||||
startLatlng = new MogoLatLng(lat, lon);
|
||||
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
|
||||
addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2, Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));
|
||||
Log.d(TAG, "自车为起点绘制 自车;" + startLatlng.lat + "," + startLatlng.lon +
|
||||
"中间扩展点" + addMiddleLoc.lon + "," + addMiddleLoc.lat + "终点:" + endLatlng.lon + "," + endLatlng.lat);
|
||||
|
||||
if (mogoPolyline != null) {
|
||||
mogoPolyline.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
|
||||
mogoPolyline.setTransparency(0.5f);
|
||||
} else {
|
||||
DrawLineInfo info = new DrawLineInfo(); // 对象
|
||||
Log.d(TAG, "安全区域的画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
|
||||
List locations = new ArrayList();
|
||||
locations.add(startLatlng);
|
||||
locations.add(addMiddleLoc);
|
||||
locations.add(endLatlng);
|
||||
info.setLocations(locations);
|
||||
info.setHeading(bearing);
|
||||
info.setWidth(mCloundWarningInfo.getRoadwidth() * 14 + 5);
|
||||
info.setDirection(mCloundWarningInfo.getDirection());
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(getContext(), info);
|
||||
}
|
||||
} else {
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -267,13 +309,13 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
@Override
|
||||
public void onCarLocationChanged2(Location latLng) {
|
||||
// Log.d(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 lat = " + latLng.getLatitude() + "--lon =" + latLng.getLongitude() + "---isSelfLineClear = " + isSelfLineClear);
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
//当行人经纬度交点 开始画线,否则清理
|
||||
if (mCloundWarningInfo != null) {
|
||||
mCloundWarningInfo.setCarLocation(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()));
|
||||
}
|
||||
drawSelfCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());
|
||||
// if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
//当行人经纬度交点 开始画线,否则清理
|
||||
if (mCloundWarningInfo != null) {
|
||||
mCloundWarningInfo.setCarLocation(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()));
|
||||
}
|
||||
drawSelfCarLine(latLng.getLongitude(), latLng.getLatitude(), latLng.getBearing());
|
||||
// }
|
||||
carLocation = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
|
||||
}
|
||||
|
||||
@@ -281,52 +323,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
|
||||
public void onCarLocationChanged(MogoLatLng latLng) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 自车为起点绘制(根据设计,前方行人/弱势交通参与者预警 getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP自车与停止线之间为蓝色预警;其他侧方预警自车与预碰撞点之间显示红色预警)
|
||||
*/
|
||||
private void drawSelfCarLine(double lon, double lat, float bearing) {
|
||||
if (!isSelfLineClear) {
|
||||
IMogoPolyline mogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
|
||||
if (mCloundWarningInfo != null) {
|
||||
MogoLatLng startLatlng = null;
|
||||
MogoLatLng endLatlng = null;
|
||||
MogoLatLng addMiddleLoc = null;
|
||||
|
||||
if (!isFirstLocation) {
|
||||
carLocation = getMogoLat(new MogoLatLng(lat, lon));
|
||||
isFirstLocation = true;
|
||||
}
|
||||
|
||||
endLatlng = new MogoLatLng(mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP ? middleLocationInStopLine.lat : mCloundWarningInfo.getCollisionLat(),
|
||||
mCloundWarningInfo.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP ? middleLocationInStopLine.lon : mCloundWarningInfo.getCollisionLon());
|
||||
//自车位置
|
||||
startLatlng = new MogoLatLng(lat, lon);
|
||||
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
|
||||
addMiddleLoc = Trigonometric.getNewLocation(startLatlng, distance / 2, Trigonometric.getAngle(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat));
|
||||
Log.d(TAG, "自车为起点绘制 自车;" + startLatlng.lat + "," + startLatlng.lon +
|
||||
"中间扩展点" + addMiddleLoc.lon + "," + addMiddleLoc.lat + "终点:" + endLatlng.lon + "," + endLatlng.lat);
|
||||
|
||||
if (mogoPolyline != null) {
|
||||
mogoPolyline.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
|
||||
mogoPolyline.setTransparency(0.5f);
|
||||
} else {
|
||||
DrawLineInfo info = new DrawLineInfo(); // 对象
|
||||
Log.d(TAG, "安全区域的画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
|
||||
List locations = new ArrayList();
|
||||
locations.add(startLatlng);
|
||||
locations.add(addMiddleLoc);
|
||||
locations.add(endLatlng);
|
||||
info.setLocations(locations);
|
||||
info.setHeading(bearing);
|
||||
info.setWidth(mCloundWarningInfo.getRoadwidth() * 14 + 5);
|
||||
info.setDirection(mCloundWarningInfo.getDirection());
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(getContext(), info);
|
||||
}
|
||||
} else {
|
||||
V2XServiceManager.getMoGoWarnPolylineManager().clearLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 补点后的停止线经纬度合集
|
||||
|
||||
@@ -41,7 +41,8 @@ public class MoGoWarnPolylineManager implements IMoGoWarnPolylineManager {
|
||||
}
|
||||
|
||||
// 连接线参数
|
||||
MogoPolylineOptions options = new MogoPolylineOptions();
|
||||
MogoPolylineOptions options = new MogoPolylineOptions()
|
||||
.setGps(true);
|
||||
List<Integer> colors = new ArrayList<>();
|
||||
|
||||
if (info.getDirection() == ALERT_THE_FRONT_CRASH_WARNING_TOP) {
|
||||
@@ -56,7 +57,6 @@ public class MoGoWarnPolylineManager implements IMoGoWarnPolylineManager {
|
||||
|
||||
Log.d(V2XConst.LOG_NAME_WARN, "MoGoWarnPolylineManager roadWidth = " + info.getWidth());
|
||||
// 线条粗细,渐变,渐变色值
|
||||
// 当前车辆位置
|
||||
options.width(info.getWidth() == 0.0 ? 60 : info.getWidth()).useGradient(true).colorValues(colors);
|
||||
List<MogoLatLng> locations = info.getLocations();
|
||||
for (int i = 0; i < locations.size(); i++) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.module.v2x.scenario.scene.livecar;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.live.manager.LiveStreamManagerImpl;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
@@ -10,6 +11,9 @@ import com.mogo.cloud.trafficlive.api.MoGoAiCloudTrafficLive;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
@@ -20,6 +24,8 @@ import com.mogo.module.v2x.voice.V2XVoiceManager;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import static com.mogo.map.marker.MarkerType.MAP_STATIC;
|
||||
import static com.mogo.map.marker.MarkerType.MAP_STATIC_TRAFFIC;
|
||||
import static com.mogo.module.v2x.V2XConst.MODULE_NAME;
|
||||
import static com.mogo.module.v2x.voice.V2XVoiceConstants.COMMAND_ZHIDAO_V2X_AHEAD_LIVE;
|
||||
import static com.mogo.module.v2x.voice.V2XVoiceConstants.COMMAND_ZHIDAO_V2X_CALL_FRONT_CAR_DEMO_UN_WAKEUP;
|
||||
@@ -31,9 +37,9 @@ import static com.mogo.service.statusmanager.StatusDescriptor.MAIN_PAGE_RESUME;
|
||||
* author : unknown
|
||||
* desc : 语音呼叫查看直播车辆 或者 路口实况 业务模块
|
||||
*/
|
||||
public class V2XVoiceCallLiveBiz {
|
||||
public class V2XVoiceCallLiveBiz implements IMogoMarkerClickListener{
|
||||
|
||||
private static final String REGISTER_LIFECYCLE_TAG = V2XVoiceCallLiveBiz.class.getSimpleName();
|
||||
private static final String REGISTER_LIFECYCLE_TAG = "V2XVoiceCallLiveBiz";
|
||||
|
||||
private V2XVoiceCallLiveBiz() {
|
||||
|
||||
@@ -72,6 +78,25 @@ public class V2XVoiceCallLiveBiz {
|
||||
this.mContext = context;
|
||||
registerLifecycleChange();
|
||||
registerVoice();
|
||||
registerMarkerClick();
|
||||
}
|
||||
|
||||
private void registerMarkerClick() {
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().registerMogoStaticMarkerClickListener(MAP_STATIC, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onStaticMarkerClicked(IMogoMarker marker) {
|
||||
Log.d(REGISTER_LIFECYCLE_TAG,"onStaticMarkerClicked marker");
|
||||
String assInfo = marker.getMarkerAssInfo();
|
||||
Log.d(REGISTER_LIFECYCLE_TAG,"onStaticMarkerClicked marker assInfo : " + assInfo);
|
||||
if (TextUtils.isEmpty(assInfo) || !assInfo.contains(MAP_STATIC_TRAFFIC)) {
|
||||
return false;
|
||||
} else {
|
||||
//点击地图上marker返回assInfo,得到路口摄像头Id,获取直播
|
||||
getSpecifiedOpenCameraLive(assInfo);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void registerLifecycleChange() {
|
||||
@@ -136,6 +161,28 @@ public class V2XVoiceCallLiveBiz {
|
||||
});
|
||||
}
|
||||
|
||||
private void getSpecifiedOpenCameraLive(String assInfo) {
|
||||
MoGoAiCloudTrafficLive.viewDesignativeIntersectionLive(assInfo, new ITrafficIntersectionLiveCallBack() {
|
||||
@Override
|
||||
public void liveUrlResult(String liveUrl) {
|
||||
if (!TextUtils.isEmpty(liveUrl)) {
|
||||
V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity = buildCallLiveParams(null, liveUrl);
|
||||
V2XPushLiveCarScenario pushLiveCarScenario = new V2XPushLiveCarScenario();
|
||||
pushLiveCarScenario.init(v2XMessageEntity);
|
||||
} else {
|
||||
Logger.d(MODULE_NAME, "getOpenRoadCameraLive 路口实况直播地址为空");
|
||||
ToastUtils.showShort(R.string.v2x_specific_live_url_null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String errorMsg) {
|
||||
Logger.d(MODULE_NAME, "getSpecifiedOpenCameraLive : " + errorMsg);
|
||||
ToastUtils.showShort(R.string.v2x_specific_live_url_null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建直播参数
|
||||
*
|
||||
@@ -156,4 +203,7 @@ public class V2XVoiceCallLiveBiz {
|
||||
return v2XMessageEntity;
|
||||
}
|
||||
|
||||
public void onDestroy(){
|
||||
MogoApisHandler.getInstance().getApis().getRegisterCenterApi().unregisterMogoStaticMarkerClickListener(MAP_STATIC, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.mogo.module.v2x.utils;
|
||||
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XPushMessageEntity;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.entity.V2XWarningEntity;
|
||||
import com.mogo.module.v2x.R;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.entity.net.V2XOptimalRouteDataRes;
|
||||
import com.mogo.module.v2x.entity.net.V2XSpecialCarRes;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
@@ -165,7 +162,7 @@ public class TestOnLineCarUtils {
|
||||
try {
|
||||
InputStream inputStream = V2XUtils.getApp()
|
||||
.getResources()
|
||||
.openRawResource(R.raw.scenario_warning_event_data);
|
||||
.openRawResource(R.raw.scenario_warning_event_data_right);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
int len = -1;
|
||||
byte[] buffer = new byte[1024];
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"type": 1,
|
||||
"lat": 26.88008312,
|
||||
"lon": 112.57147295,
|
||||
"lat": 26.879390180525974,
|
||||
"lon": 112.56927332599024,
|
||||
"distance": 2,
|
||||
"collisionLat": 26.88008312,
|
||||
"collisionLon": 112.57147295,
|
||||
"collisionLat": 26.879413602631494,
|
||||
"collisionLon": 112.56942224899758,
|
||||
"stopLines": [
|
||||
{
|
||||
"lat": 26.88008312,
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
{
|
||||
"type": 0,
|
||||
"lat": 26.880223,
|
||||
"lon": 112.571949,
|
||||
"lat": 26.91837250865101,
|
||||
"lon": 112.5631081,
|
||||
"distance": 2,
|
||||
"collisionLat": 26.880238,
|
||||
"collisionLon": 112.571949,
|
||||
"collisionLat": 26.91837250865101,
|
||||
"collisionLon": 112.5631081,
|
||||
"stopLines": [
|
||||
{
|
||||
"lat": 26.880223,
|
||||
"lon": 112.571949
|
||||
"lat": 26.91837250865101,
|
||||
"lon": 112.5631081
|
||||
},
|
||||
{
|
||||
"lat": 26.880200,
|
||||
"lon": 112.571949
|
||||
"lat": 26.91840847737797,
|
||||
"lon": 112.5631081
|
||||
}
|
||||
],
|
||||
"from": 1,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"type": 2,
|
||||
"lat": 26.88008312,
|
||||
"lon": 112.57147295,
|
||||
"lat": 26.879413602631494,
|
||||
"lon": 112.56942224899758,
|
||||
"distance": 2,
|
||||
"collisionLat": 26.88008312,
|
||||
"collisionLon": 112.57147295,
|
||||
"collisionLat": 26.879393211872856,
|
||||
"collisionLon": 112.56917110603266,
|
||||
"stopLines": [
|
||||
{
|
||||
"lat": 26.88008312,
|
||||
@@ -17,5 +17,6 @@
|
||||
<string name="recommended_route">线路推荐</string>
|
||||
<string name="v2x_recommond_route_size">26px</string>
|
||||
<string name="v2x_front_live_url_null">前方路口暂无直播</string>
|
||||
<string name="v2x_specific_live_url_null">此摄像头暂无直播</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -105,6 +105,22 @@ public interface IMogoRegisterCenter extends IProvider {
|
||||
*/
|
||||
void unregisterMogoMarkerClickListener( String tag );
|
||||
|
||||
/**
|
||||
* 注册地图上静态marker点击监听函数
|
||||
*
|
||||
* @param tag
|
||||
* @param listener
|
||||
* @return
|
||||
*/
|
||||
void registerMogoStaticMarkerClickListener( String tag, IMogoMarkerClickListener listener );
|
||||
|
||||
/**
|
||||
* 注销定位监听函数
|
||||
*
|
||||
* @param tag
|
||||
*/
|
||||
void unregisterMogoStaticMarkerClickListener( String tag, IMogoMarkerClickListener listener );
|
||||
|
||||
/**
|
||||
* 注册巡航监听
|
||||
*
|
||||
|
||||
@@ -72,6 +72,7 @@ public class AdasObjectUtils {
|
||||
result.carId = model.getCarId();
|
||||
result.dataAccuracy = model.dataAccuracy;
|
||||
result.distance = model.distance;
|
||||
// result.drawlevel = model.drawlevel; //liyz
|
||||
result.mortonCode = MortonCode.wrapEncodeMorton(result.lon, result.lat);
|
||||
IMogoMapUIController mogoMapUIController = ARouter.getInstance().navigation(IMogoServiceApis.class).getMapServiceApi().getMapUIController();
|
||||
if (mogoMapUIController != null) {
|
||||
|
||||
@@ -191,7 +191,7 @@ public class MogoADASController implements IMogoADASController {
|
||||
model.setSpeed( bean.getSpeed() );
|
||||
model.setDataAccuracy( bean.getDataAccuracy() );
|
||||
model.setDistance( bean.getDistance() );
|
||||
|
||||
// model.set
|
||||
|
||||
data.add( model );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user