[Update]优化全览模式摄像头呈现和播放
This commit is contained in:
@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.overview
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import java.util.*
|
||||
|
||||
@Entity(tableName = "t_device")
|
||||
data class Infrastructure(
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
package com.mogo.eagle.core.function.overview.vm
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.*
|
||||
import com.mogo.eagle.core.function.overview.Infrastructure
|
||||
import com.mogo.eagle.core.function.overview.OverviewDao
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.lang.Exception
|
||||
|
||||
class OverViewModel(
|
||||
@@ -48,7 +45,6 @@ class OverViewModel(
|
||||
// overviewDao.listAllInfStructures()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
Log.e("cff", "${e.cause}${e.message}")
|
||||
null
|
||||
}
|
||||
data?.let {
|
||||
@@ -63,7 +59,6 @@ class OverViewModel(
|
||||
overviewDao.updateGeoHash(id, geoHash)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
Log.e("cff", "${e.cause}${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ import com.mogo.eagle.core.function.overview.Infrastructure;
|
||||
import com.mogo.eagle.core.function.smp.view.ISmallMapDirectionView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.module.common.utils.DrivingDirectionUtils;
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
@@ -147,7 +146,8 @@ public class AMapCustomView
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this);
|
||||
//设置全览模式
|
||||
overLayerView.setOnClickListener(v -> {
|
||||
mAMapNaviView.displayOverview();
|
||||
CallerHmiManager.INSTANCE.hideSmallFragment();
|
||||
// mAMapNaviView.displayOverview();
|
||||
});
|
||||
// 注册定位监听
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this);
|
||||
@@ -738,14 +738,38 @@ public class AMapCustomView
|
||||
}
|
||||
ArrayList<MarkerOptions> markerOptionsList = new ArrayList();
|
||||
for (ArrayList<Infrastructure> structureList : pathMap.values()) {
|
||||
int firstQuadrantCt = 0, secondQuadrantCt = 0, thirdQuadrantCt = 0, forthQuadrantCt = 0;
|
||||
// 每个GeoHash内根据坐标系象限分散开摄像头icon显示
|
||||
for (Infrastructure structure : structureList) {
|
||||
MarkerOptions markerOption = new MarkerOptions();
|
||||
LatLng latLng = new LatLng(Double.valueOf(structure.getLat()),
|
||||
Double.valueOf(structure.getLon()));
|
||||
markerOption.position(latLng);
|
||||
markerOption.icon(BitmapDescriptorFactory.fromBitmap(
|
||||
BitmapFactory.decodeResource(getResources(), R.drawable.video_nor)
|
||||
));
|
||||
if (structure.getHeading() >= 0 && structure.getHeading() <= 90) {
|
||||
markerOption.anchor(0.5f * firstQuadrantCt, 0.5f + 0.5f * firstQuadrantCt);
|
||||
markerOption.icon(BitmapDescriptorFactory.fromBitmap(
|
||||
BitmapFactory.decodeResource(getResources(),R.drawable.video_icon_right)
|
||||
));
|
||||
firstQuadrantCt++;
|
||||
} else if (structure.getHeading() >= 90 && structure.getHeading() <= 180) {
|
||||
markerOption.anchor(0.5f * secondQuadrantCt, 0.5f * secondQuadrantCt);
|
||||
markerOption.icon(BitmapDescriptorFactory.fromBitmap(
|
||||
BitmapFactory.decodeResource(getResources(),R.drawable.video_icon_right)
|
||||
));
|
||||
secondQuadrantCt++;
|
||||
} else if (structure.getHeading() >= 180 && structure.getHeading() <= 270) {
|
||||
markerOption.anchor(0.5f + 0.5f * thirdQuadrantCt, 0.5f * thirdQuadrantCt);
|
||||
markerOption.icon(BitmapDescriptorFactory.fromBitmap(
|
||||
BitmapFactory.decodeResource(getResources(),R.drawable.video_icon_left)
|
||||
));
|
||||
thirdQuadrantCt++;
|
||||
} else {
|
||||
markerOption.anchor(0.75f + 0.25f * forthQuadrantCt, 0.75f + 0.25f * forthQuadrantCt);
|
||||
markerOption.icon(BitmapDescriptorFactory.fromBitmap(
|
||||
BitmapFactory.decodeResource(getResources(),R.drawable.video_icon_left)
|
||||
));
|
||||
forthQuadrantCt++;
|
||||
}
|
||||
posInfMap.put(latLng, structure);
|
||||
markerOptionsList.add(markerOption);
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
Reference in New Issue
Block a user