Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
Conflicts: app/src/main/java/com/navinfo/omqs/ui/activity/map/MainActivity.kt app/src/main/java/com/navinfo/omqs/ui/activity/map/MainViewModel.kt app/src/main/java/com/navinfo/omqs/ui/fragment/evaluationresult/EvaluationResultViewModel.kt collect-library/src/main/java/com/navinfo/collect/library/map/handler/MarkHandler.kt
This commit is contained in:
@@ -1707,48 +1707,56 @@
|
||||
</m>0
|
||||
<!-- 道路边界类型 -->
|
||||
<m v="OMDB_RDBOUND_BOUNDARYTYPE">
|
||||
<outline-layer id="boundaryType" stroke="#fcba5a" width="0.2" />
|
||||
<outline-layer id="boundaryType" stroke="#8e44ad" width="0.2" />
|
||||
<m k="boundaryType" v="0|2|3|4|5|6|7|8|9">
|
||||
<line stroke="#ffffff" use="boundaryType" width="0.2"/>
|
||||
</m>
|
||||
<m k="boundaryType" v="1">
|
||||
<!--无标线无可区分边界-->
|
||||
<line dasharray="20,8" repeat-start="0" stroke="#ffffff" width="0.2"/>
|
||||
</m>
|
||||
<!-- <outline-layer id="boundaryType" stroke="#fcba5a" width="0.2" />
|
||||
<m k="boundaryType" v="0">
|
||||
<!--不应用-->
|
||||
<!–不应用–>
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
<lineSymbol repeat-gap="12" repeat-start="12" symbol-height="16" symbol-width="16" src="assets:omdb/icon_2083_0.svg" />
|
||||
</m>
|
||||
<m k="boundaryType" v="1">
|
||||
<!--无标线无可区分边界-->
|
||||
<!–无标线无可区分边界–>
|
||||
<line dasharray="10,2,2,2,2,2,2,2" repeat-start="0" stroke="#fcba5a" width="0.2" />
|
||||
</m>
|
||||
<m k="boundaryType" v="2">
|
||||
<!--标线-->
|
||||
<!–标线–>
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
</m>
|
||||
<m k="boundaryType" v="3">
|
||||
<!--路牙-->
|
||||
<!–路牙–>
|
||||
<line dasharray="10,4" repeat-start="0" stroke="#fcba5a" width="0.2" />
|
||||
</m>
|
||||
<m k="boundaryType" v="4">
|
||||
<!--护栏-->
|
||||
<!–护栏–>
|
||||
<line dasharray="10,2,2,2" repeat-start="0" stroke="#fcba5a" width="0.2"/>
|
||||
</m>
|
||||
<m k="boundaryType" v="5">
|
||||
<!--墙-->
|
||||
<!–墙–>
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
<line dasharray="10,5" stroke="#fcba5a" width="0.5" />
|
||||
</m>
|
||||
<m k="boundaryType" v="6">
|
||||
<!--道路面铺设边缘-->
|
||||
<!–道路面铺设边缘–>
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
<lineSymbol repeat-gap="32" repeat-start="0" symbol-height="32" src="assets:omdb/icon_2083_6.svg" />
|
||||
</m>
|
||||
<m k="boundaryType" v="7">
|
||||
<!--虚拟三角岛-->
|
||||
<!–虚拟三角岛–>
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
<line src="assets:omdb/icon_2083_7_1.svg" symbol-height="12" symbol-width="12" symbol-percent="20" width="1" />
|
||||
</m>
|
||||
<m k="boundaryType" v="9">
|
||||
<!--杆状障碍物-->
|
||||
<!–杆状障碍物–>
|
||||
<line stroke="#fcba5a" use="boundaryType"/>
|
||||
<lineSymbol repeat-gap="16" repeat-start="12" symbol-height="24" symbol-width="8" src="assets:omdb/icon_2083_9.svg" />
|
||||
</m>
|
||||
</m>-->
|
||||
</m>
|
||||
<!-- 车道边界类型 -->
|
||||
<m v="OMDB_LANE_MARK_BOUNDARYTYPE">
|
||||
@@ -1758,13 +1766,13 @@
|
||||
<m v="2">
|
||||
<m k="markType">
|
||||
<!--其他|实线-->
|
||||
<m v="0|1">
|
||||
<m v="0|1|2|3|4|5|6|7|8">
|
||||
<m k="markColor">
|
||||
<m v="0|1">
|
||||
<m v="1">
|
||||
<line stroke="#ffffff" use="boundaryType" />
|
||||
</m>
|
||||
<m v="2">
|
||||
<line stroke="#eccc68" use="boundaryType" />
|
||||
<line dasharray="10,2,2,2,2,2,2,2" repeat-start="0" stroke="#eccc68" use="boundaryType" />
|
||||
</m>
|
||||
<m v="6">
|
||||
<line stroke="#0000ff" use="boundaryType" />
|
||||
@@ -1772,12 +1780,12 @@
|
||||
<m v="7">
|
||||
<line stroke="#00ff00" use="boundaryType" />
|
||||
</m>
|
||||
<m v="9">
|
||||
<m v="0|9">
|
||||
<line stroke="#8e44ad" use="boundaryType" />
|
||||
</m>
|
||||
</m>
|
||||
</m>
|
||||
<!--虚线-->
|
||||
<!-- <!–虚线–>
|
||||
<m v="2">
|
||||
<m k="markColor">
|
||||
<m v="0|1">
|
||||
@@ -1802,18 +1810,21 @@
|
||||
</m>
|
||||
</m>
|
||||
</m>
|
||||
<!--导流区边线-->
|
||||
<!–导流区边线–>
|
||||
<m v="4">
|
||||
<line outline="boundary" stroke="#545D6C"></line>
|
||||
<lineSymbol repeat-gap="0.5" repeat-start="0"
|
||||
src="assets:omdb/icon_right.png" />
|
||||
</m>
|
||||
<!-- <!–铺设路面边缘–>-->
|
||||
<!-- <m v="5">-->
|
||||
<!-- <line outline="#ffffff" fix="true" src="assets:omdb/icon_close.png" stroke="#ffffffff" use="boundaryType"/>-->
|
||||
<!-- </m>-->
|
||||
</m>-->
|
||||
</m>
|
||||
</m>
|
||||
<m v="0|3|4|5|6|7|8|9">
|
||||
<line stroke="#ffffff" use="boundaryType" />
|
||||
</m>
|
||||
<!--只区分虚线与实线-->
|
||||
<m v="1">
|
||||
<line dasharray="20,8" repeat-start="0" stroke="#ffffff" width="0.2"/>
|
||||
</m>
|
||||
</m>
|
||||
</m>
|
||||
|
||||
|
||||
@@ -47,6 +47,9 @@ public interface INiLocationDao {
|
||||
@Query("SELECT * FROM niLocation")
|
||||
List<NiLocation> findAll();
|
||||
|
||||
@Query("SELECT * FROM niLocation where time>=:startTime and time<=:endTime and taskId=:taskId")
|
||||
List<NiLocation> taskIdAndTimeTofindList(String taskId,long startTime,long endTime);
|
||||
|
||||
@Query("SELECT * FROM niLocation where taskId =:taskId")
|
||||
List<NiLocation> findToTaskIdAll(String taskId);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.UUID;
|
||||
* @Date 2022/4/14
|
||||
* @Description: ${TODO}(数据基类)
|
||||
*/
|
||||
public class Feature implements Serializable, Cloneable {
|
||||
public class Feature extends Object implements Serializable, Cloneable {
|
||||
// //主键
|
||||
// @PrimaryKey(autoGenerate = true)
|
||||
// public int rowId;
|
||||
|
||||
@@ -30,7 +30,7 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
//
|
||||
// }
|
||||
|
||||
val niLocationFlow = MutableSharedFlow<NiLocation>(3)
|
||||
val niLocationFlow = MutableSharedFlow<NiLocation>(5)
|
||||
|
||||
init {
|
||||
///添加定位图层到地图,[NIMapView.LAYER_GROUPS.NAVIGATION] 是最上层layer组
|
||||
@@ -67,18 +67,12 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
val errorCode = it.locType
|
||||
mCurrentLocation = it
|
||||
mLocationLayer.setPosition(it.latitude, it.longitude, it.radius)
|
||||
// Log.e(
|
||||
// "qj",
|
||||
// "location==${it.longitude}==errorCode===$errorCode===${it.locTypeDescription}"
|
||||
// )
|
||||
Log.e("qj", "location==${it.longitude}==errorCode===$errorCode===${it.locTypeDescription}")
|
||||
|
||||
// if (niLocationListener != null) {
|
||||
getCurrentNiLocation()?.let { it1 ->
|
||||
mContext.lifecycleScope.launch(Dispatchers.Default) {
|
||||
mContext.lifecycleScope.launch {
|
||||
niLocationFlow.emit(it1)
|
||||
}
|
||||
|
||||
// }// niLocationListener.call(it1) }
|
||||
}
|
||||
//第一次定位成功显示当前位置
|
||||
if (this.bFirst) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.util.Log
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import com.navinfo.collect.library.R
|
||||
@@ -197,6 +196,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
if (listener is OnNiLocationItemListener) {
|
||||
listener.onNiLocation(
|
||||
tag,
|
||||
index,
|
||||
(niLocationItemizedLayer.itemList[index] as MarkerItem).uid as NiLocation
|
||||
)
|
||||
break
|
||||
@@ -211,6 +211,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
addLayer(layer, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
|
||||
layer
|
||||
}
|
||||
@@ -287,7 +288,8 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
fun addMarker(
|
||||
geoPoint: GeoPoint,
|
||||
title: String?,
|
||||
description: String? = ""
|
||||
description: String? = "",
|
||||
uid: java.lang.Object? = null,
|
||||
) {
|
||||
var marker: MarkerItem? = null
|
||||
for (e in mDefaultMarkerLayer.itemList) {
|
||||
@@ -302,6 +304,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
tempTitle = StringUtil.createUUID()
|
||||
}
|
||||
val marker = MarkerItem(
|
||||
uid,
|
||||
tempTitle,
|
||||
description,
|
||||
geoPoint
|
||||
@@ -317,6 +320,14 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
}
|
||||
}
|
||||
|
||||
fun getCurrentMark(): MarkerInterface? {
|
||||
|
||||
if (mDefaultMarkerLayer != null) {
|
||||
return mDefaultMarkerLayer.itemList[mDefaultMarkerLayer.itemList.size - 1]
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除marker
|
||||
*/
|
||||
@@ -484,70 +495,61 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
/**
|
||||
* 添加质检数据marker
|
||||
*/
|
||||
public suspend fun addNiLocationMarkerItem(niLocation: NiLocation) {
|
||||
fun addNiLocationMarkerItem(niLocation: NiLocation) {
|
||||
synchronized(this) {
|
||||
Log.e("jingo", "插入定位点0 ")
|
||||
|
||||
var itemizedLayer: ItemizedLayer? = null
|
||||
|
||||
val direction: Double = niLocation.direction
|
||||
|
||||
val geoMarkerItem: MarkerItem = ClusterMarkerItem(
|
||||
niLocation,
|
||||
niLocation.id,
|
||||
niLocation.time,
|
||||
GeoPoint(niLocation.latitude, niLocation.longitude)
|
||||
)
|
||||
|
||||
//角度
|
||||
when (niLocation.media) {
|
||||
0 -> {
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
if (direction != 0.0) {
|
||||
val symbolGpsTemp =
|
||||
MarkerSymbol(niLocationBitmap, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolGpsTemp
|
||||
geoMarkerItem.setRotation(direction.toFloat())
|
||||
} else {
|
||||
val symbolGpsTemp =
|
||||
MarkerSymbol(niLocationBitmap2, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolGpsTemp
|
||||
}
|
||||
Log.e(
|
||||
"jingo",
|
||||
"插入定位点1 ${geoMarkerItem.geoPoint.longitude} ${geoMarkerItem.geoPoint.latitude}"
|
||||
)
|
||||
niLocationItemizedLayer.addItem(geoMarkerItem)
|
||||
itemizedLayer = niLocationItemizedLayer
|
||||
}
|
||||
|
||||
1 -> {
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
if (direction != 0.0) {
|
||||
val symbolLidarTemp =
|
||||
MarkerSymbol(niLocationBitmap1, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolLidarTemp
|
||||
geoMarkerItem.setRotation(direction.toFloat())
|
||||
} else {
|
||||
val symbolGpsTemp =
|
||||
MarkerSymbol(niLocationBitmap3, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolGpsTemp
|
||||
}
|
||||
Log.e(
|
||||
"jingo",
|
||||
"插入定位点2 ${geoMarkerItem.geoPoint.longitude} ${geoMarkerItem.geoPoint.latitude}"
|
||||
)
|
||||
niLocationItemizedLayer.addItem(geoMarkerItem)
|
||||
itemizedLayer = niLocationItemizedLayer
|
||||
}
|
||||
|
||||
}
|
||||
itemizedLayer?.update()
|
||||
var geoMarkerItem = createNILocationBitmap(niLocation)
|
||||
niLocationItemizedLayer.addItem(geoMarkerItem)
|
||||
niLocationItemizedLayer.update()
|
||||
}
|
||||
}
|
||||
|
||||
private fun createNILocationBitmap(niLocation: NiLocation): MarkerItem {
|
||||
|
||||
val direction: Double = niLocation.direction
|
||||
|
||||
val geoMarkerItem: MarkerItem = ClusterMarkerItem(
|
||||
niLocation,
|
||||
niLocation.id,
|
||||
niLocation.time,
|
||||
GeoPoint(niLocation.latitude, niLocation.longitude)
|
||||
)
|
||||
|
||||
//角度
|
||||
when (niLocation.media) {
|
||||
0 -> {
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
if (direction > 0.0) {
|
||||
val symbolGpsTemp =
|
||||
MarkerSymbol(niLocationBitmap, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolGpsTemp
|
||||
geoMarkerItem.setRotation(direction.toFloat())
|
||||
} else {
|
||||
val symbolGpsTemp =
|
||||
MarkerSymbol(niLocationBitmap2, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolGpsTemp
|
||||
}
|
||||
}
|
||||
|
||||
1 -> {
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
//角度不为0时需要预先设置marker样式并进行角度设置,否则使用图层默认的sym即可
|
||||
if (direction > 0.0) {
|
||||
val symbolLidarTemp =
|
||||
MarkerSymbol(niLocationBitmap1, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolLidarTemp
|
||||
geoMarkerItem.setRotation(direction.toFloat())
|
||||
} else {
|
||||
val symbolGpsTemp =
|
||||
MarkerSymbol(niLocationBitmap3, MarkerSymbol.HotspotPlace.CENTER, false)
|
||||
geoMarkerItem.marker = symbolGpsTemp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return geoMarkerItem
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 文字和图片拼装,文字换行
|
||||
@@ -775,6 +777,38 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
mMapView.updateMap(true)
|
||||
}
|
||||
|
||||
fun getNILocationItemizedLayerSize(): Int {
|
||||
return niLocationItemizedLayer.itemList.size
|
||||
}
|
||||
|
||||
fun getNILocation(index: Int): NiLocation? {
|
||||
return if (index > -1 && index < getNILocationItemizedLayerSize()) {
|
||||
((niLocationItemizedLayer.itemList[index]) as MarkerItem).uid as NiLocation
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun getNILocationIndex(niLocation: NiLocation): Int? {
|
||||
|
||||
var list = niLocationItemizedLayer.itemList
|
||||
|
||||
if (niLocation != null && list.isNotEmpty()) {
|
||||
|
||||
var index = -1
|
||||
|
||||
list.forEach {
|
||||
|
||||
index += 1
|
||||
|
||||
if (((it as MarkerItem).uid as NiLocation).id.equals(niLocation.id)) {
|
||||
return index
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
interface OnQsRecordItemClickListener : BaseClickListener {
|
||||
@@ -786,5 +820,5 @@ interface ONNoteItemClickListener : BaseClickListener {
|
||||
}
|
||||
|
||||
interface OnNiLocationItemListener : BaseClickListener {
|
||||
fun onNiLocation(tag: String, it: NiLocation)
|
||||
fun onNiLocation(tag: String, index: Int, it: NiLocation)
|
||||
}
|
||||
Reference in New Issue
Block a user