1、增加要素线捕捉开关2、增加图层开关与要素捕捉联动3、个人中心增加Marker显隐开关4、修复道路属性不显示道路种别问题
This commit is contained in:
parent
028fda54b5
commit
ab27048d54
@ -152,6 +152,7 @@
|
||||
"table": "OMDB_BRIDGE",
|
||||
"code": 2201,
|
||||
"name": "桥",
|
||||
"catch":true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
@ -169,6 +170,7 @@
|
||||
"name": "隧道",
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"catch":true,
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
@ -205,6 +207,7 @@
|
||||
"checkLinkId": false,
|
||||
"zoomMin": 18,
|
||||
"zoomMax": 20,
|
||||
"catch":true,
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
@ -319,6 +322,7 @@
|
||||
"table": "OMDB_SPEEDLIMIT_COND",
|
||||
"code": 4003,
|
||||
"name": "条件点限速",
|
||||
"catch":true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
@ -334,6 +338,7 @@
|
||||
"table": "OMDB_SPEEDLIMIT_VAR",
|
||||
"code": 4004,
|
||||
"name": "可变点限速",
|
||||
"catch":true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
@ -540,6 +545,7 @@
|
||||
"code": 2004,
|
||||
"name": "道路属性",
|
||||
"existSubCode": true,
|
||||
"catch":true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
@ -577,6 +583,7 @@
|
||||
"table": "OMDB_ROUNDABOUT",
|
||||
"code": 2204,
|
||||
"name": "环岛",
|
||||
"catch":true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 17,
|
||||
"transformer": [
|
||||
|
@ -108,6 +108,16 @@ class Constant {
|
||||
*/
|
||||
var MapRotateEnable = false
|
||||
|
||||
/**
|
||||
* Marker显隐
|
||||
*/
|
||||
var MapMarkerCloseEnable = false
|
||||
|
||||
/**
|
||||
* 是否开启线捕捉
|
||||
*/
|
||||
var MapCatchLine = false
|
||||
|
||||
/**
|
||||
* 全要素捕捉
|
||||
*/
|
||||
|
@ -21,6 +21,7 @@ import org.locationtech.jts.operation.buffer.BufferOp
|
||||
import org.oscim.core.GeoPoint
|
||||
import org.oscim.core.MercatorProjection
|
||||
import javax.inject.Inject
|
||||
import kotlin.reflect.jvm.jvmName
|
||||
import kotlin.streams.toList
|
||||
|
||||
class RealmOperateHelper() {
|
||||
@ -158,6 +159,7 @@ class RealmOperateHelper() {
|
||||
result.addAll(it)
|
||||
}
|
||||
}
|
||||
realm.close()
|
||||
return result
|
||||
}
|
||||
|
||||
@ -278,36 +280,30 @@ class RealmOperateHelper() {
|
||||
val yEnd = tileYSet.stream().max(Comparator.naturalOrder()).orElse(null)
|
||||
val realm = getSelectTaskRealmInstance()
|
||||
var realmList = mutableListOf<RenderEntity>()
|
||||
val realmQuery = getSelectTaskRealmTools(RenderEntity::class.java, false)
|
||||
.greaterThanOrEqualTo("tileX", xStart)
|
||||
.lessThanOrEqualTo("tileX", xEnd)
|
||||
.greaterThanOrEqualTo("tileY", yStart)
|
||||
.lessThanOrEqualTo("tileY", yEnd)
|
||||
// 筛选不显示的数据
|
||||
if (catchAll) {
|
||||
// 查询realm中对应tile号的数据
|
||||
realmList = getSelectTaskRealmTools(RenderEntity::class.java, false)
|
||||
.greaterThanOrEqualTo("tileX", xStart)
|
||||
.lessThanOrEqualTo("tileX", xEnd)
|
||||
.greaterThanOrEqualTo("tileY", yStart)
|
||||
.lessThanOrEqualTo("tileY", yEnd)
|
||||
.findAll()
|
||||
realmList = realmQuery.findAll()
|
||||
} else {
|
||||
// 查询realm中对应tile号的数据
|
||||
if (Constant.CATCH_ALL) {
|
||||
realmList = getSelectTaskRealmTools(RenderEntity::class.java, false)
|
||||
.greaterThanOrEqualTo("tileX", xStart)
|
||||
.lessThanOrEqualTo("tileX", xEnd)
|
||||
.greaterThanOrEqualTo("tileY", yStart)
|
||||
.lessThanOrEqualTo("tileY", yEnd)
|
||||
.findAll()
|
||||
realmList = realmQuery.findAll()
|
||||
} else {
|
||||
realmList = getSelectTaskRealmTools(RenderEntity::class.java, false)
|
||||
.greaterThanOrEqualTo("tileX", xStart)
|
||||
.lessThanOrEqualTo("tileX", xEnd)
|
||||
.greaterThanOrEqualTo("tileY", yStart)
|
||||
.lessThanOrEqualTo("tileY", yEnd)
|
||||
.greaterThan("catchEnable", 0)
|
||||
.findAll()
|
||||
realmList = realmQuery.greaterThan("catchEnable", 0).findAll()
|
||||
}
|
||||
}
|
||||
// 将获取到的数据和查询的polygon做相交,只返回相交的数据
|
||||
val queryResult = realmList?.stream()?.filter {
|
||||
polygon.intersects(it.wkt)
|
||||
if(Constant.MapCatchLine){
|
||||
polygon.intersects(it.wkt) && it.wkt?.geometryType?.uppercase().equals("LINESTRING")||it.wkt?.geometryType?.uppercase().equals("POLYGON")
|
||||
}else{
|
||||
polygon.intersects(it.wkt) && it.wkt?.geometryType?.uppercase().equals("POINT")||it.wkt?.geometryType?.uppercase().equals("POLYGON")
|
||||
}
|
||||
}?.toList()
|
||||
queryResult?.let {
|
||||
if (sort) {
|
||||
@ -331,7 +327,7 @@ class RealmOperateHelper() {
|
||||
val result = mutableListOf<RenderEntity>()
|
||||
val realm = getSelectTaskRealmInstance()
|
||||
val realmList = getSelectTaskRealmTools(RenderEntity::class.java, false)
|
||||
.notEqualTo("table", DataCodeEnum.OMDB_RD_LINK_KIND.name)
|
||||
.notEqualTo("table", DataCodeEnum.OMDB_RD_LINK.name)
|
||||
.equalTo("properties['${LinkTable.linkPid}']", linkPid)
|
||||
.findAll()
|
||||
result.addAll(realm.copyFromRealm(realmList))
|
||||
@ -433,19 +429,26 @@ class RealmOperateHelper() {
|
||||
clazz: Class<E>,
|
||||
enableSql: Boolean
|
||||
): RealmQuery<E> {
|
||||
return if (MapParamUtils.getDataLayerEnum() != null) {
|
||||
|
||||
var realmQuery = getSelectTaskRealmInstance().where(clazz)
|
||||
if (MapParamUtils.getDataLayerEnum() != null) {
|
||||
if (enableSql) {
|
||||
var sql =
|
||||
" enable${MapParamUtils.getDataLayerEnum().sql}"
|
||||
getSelectTaskRealmInstance().where(clazz).rawPredicate(sql)
|
||||
} else {
|
||||
getSelectTaskRealmInstance().where(clazz)
|
||||
}
|
||||
|
||||
} else {
|
||||
getSelectTaskRealmInstance().where(clazz)
|
||||
}
|
||||
if(clazz.name==RenderEntity::class.jvmName){
|
||||
// 筛选不显示的数据
|
||||
if (com.navinfo.collect.library.system.Constant.HAD_LAYER_INVISIABLE_ARRAY != null && com.navinfo.collect.library.system.Constant.HAD_LAYER_INVISIABLE_ARRAY.size > 0) {
|
||||
realmQuery.beginGroup()
|
||||
for (type in com.navinfo.collect.library.system.Constant.HAD_LAYER_INVISIABLE_ARRAY) {
|
||||
realmQuery.notEqualTo("table", type)
|
||||
}
|
||||
realmQuery.endGroup()
|
||||
}
|
||||
}
|
||||
return realmQuery
|
||||
}
|
||||
|
||||
fun getSelectTaskRealmInstance(): Realm {
|
||||
|
@ -781,10 +781,11 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新地图
|
||||
* 线捕捉开关
|
||||
*/
|
||||
fun refrushOnclick(view: View) {
|
||||
mapController.layerManagerHandler.updateOMDBVectorTileLayer()
|
||||
fun catchLineOnclick(view: View) {
|
||||
viewModel.setCatchRoad(!viewModel.isCatchRoad())
|
||||
binding.mainActivityMapCatchLine.isSelected = viewModel.isCatchRoad()
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -180,6 +180,11 @@ class MainViewModel @Inject constructor(
|
||||
*/
|
||||
private var bHighRoad = true
|
||||
|
||||
/**
|
||||
* 是不是捕捉线
|
||||
*/
|
||||
private var bCatchRoad = false
|
||||
|
||||
/**
|
||||
* 是不是选择轨迹点
|
||||
*/
|
||||
@ -597,11 +602,15 @@ class MainViewModel @Inject constructor(
|
||||
*/
|
||||
private suspend fun captureItem(point: GeoPoint) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
var buffer = 3.2
|
||||
if(mapController.mMapView.mapLevel>=18){
|
||||
buffer = 2.0
|
||||
}
|
||||
val itemList = realmOperateHelper.queryElement(
|
||||
GeometryTools.createPoint(
|
||||
point.longitude, point.latitude
|
||||
),
|
||||
buffer = 3.2, catchAll = false,
|
||||
buffer = buffer, catchAll = false,
|
||||
)
|
||||
//增加道路线过滤原则
|
||||
val filterResult = itemList.filter {
|
||||
@ -1111,6 +1120,14 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启捕捉线
|
||||
*/
|
||||
fun setCatchRoad(select: Boolean) {
|
||||
bCatchRoad = select
|
||||
Constant.MapCatchLine = bCatchRoad
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否开启线高亮
|
||||
*/
|
||||
@ -1118,6 +1135,13 @@ class MainViewModel @Inject constructor(
|
||||
return bHighRoad
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否开启捕捉线
|
||||
*/
|
||||
fun isCatchRoad(): Boolean {
|
||||
return bCatchRoad
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启轨迹选择
|
||||
*/
|
||||
|
@ -152,6 +152,17 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
||||
it.title = "锁定地图旋转及视角"
|
||||
}
|
||||
}
|
||||
R.id.personal_center_menu_marker -> {
|
||||
niMapController.mMapView.vtmMap.eventLayer.enableTilt(Constant.MapRotateEnable)
|
||||
Constant.MapMarkerCloseEnable = !Constant.MapMarkerCloseEnable
|
||||
//增加开关控制
|
||||
niMapController.markerHandle.setQsRecordMarkEnable(Constant.MapMarkerCloseEnable)
|
||||
if (Constant.MapMarkerCloseEnable) {
|
||||
it.title = "显示Marker"
|
||||
} else {
|
||||
it.title = "隐藏Marker"
|
||||
}
|
||||
}
|
||||
R.id.personal_center_menu_catch_all -> {
|
||||
Constant.CATCH_ALL = !Constant.CATCH_ALL
|
||||
if (Constant.CATCH_ALL) {
|
||||
@ -220,6 +231,13 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
||||
it.title = "开启全要素捕捉"
|
||||
}
|
||||
}
|
||||
R.id.personal_center_menu_marker -> {
|
||||
if (Constant.MapMarkerCloseEnable) {
|
||||
it.title = "显示Marker"
|
||||
} else {
|
||||
it.title = "隐藏Marker"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -487,31 +487,55 @@ class TaskViewModel @Inject constructor(
|
||||
fun checkUploadTask(context: Context, taskBean: TaskBean) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val realm = Realm.getDefaultInstance()
|
||||
var result = 0
|
||||
val map: MutableMap<TaskBean, Boolean> = HashMap<TaskBean, Boolean>()
|
||||
taskBean.hadLinkDvoList.forEach { hadLinkDvoBean ->
|
||||
val objects =
|
||||
realm.where(QsRecordBean::class.java).equalTo("linkId", hadLinkDvoBean.linkPid)
|
||||
.and().equalTo("taskId", hadLinkDvoBean.taskId).findAll()
|
||||
val map: MutableMap<TaskBean, Boolean> = HashMap<TaskBean, Boolean>()
|
||||
if (objects.isEmpty() && hadLinkDvoBean.reason.isEmpty()) {
|
||||
withContext(Dispatchers.Main) {
|
||||
liveDataTaskUpload.postValue(map)
|
||||
val mDialog = FirstDialog(context)
|
||||
mDialog.setTitle("提示?")
|
||||
mDialog.setMessage("此任务中存在未测评link,请确认!")
|
||||
mDialog.setPositiveButton(
|
||||
"确定"
|
||||
) { _, _ ->
|
||||
mDialog.dismiss()
|
||||
map[taskBean] = true
|
||||
liveDataTaskUpload.postValue(map)
|
||||
}
|
||||
mDialog.setNegativeButton(
|
||||
"取消"
|
||||
) { _, _ -> mDialog.dismiss() }
|
||||
mDialog.show()
|
||||
if(hadLinkDvoBean.linkStatus==3){
|
||||
result = 1
|
||||
realm.close()
|
||||
return@forEach
|
||||
}else{
|
||||
result = 2
|
||||
}
|
||||
return@launch
|
||||
}
|
||||
}
|
||||
if(result==1){
|
||||
withContext(Dispatchers.Main) {
|
||||
liveDataTaskUpload.postValue(map)
|
||||
val mDialog = FirstDialog(context)
|
||||
mDialog.setTitle("提示?")
|
||||
mDialog.setMessage("此任务中存在新增Link无问题记录,请添加至少一条记录!")
|
||||
mDialog.setPositiveButton(
|
||||
"确定"
|
||||
) { _, _ ->
|
||||
mDialog.dismiss()
|
||||
}
|
||||
mDialog.setCancelVisibility(View.GONE)
|
||||
mDialog.show()
|
||||
}
|
||||
}else if(result==2){
|
||||
withContext(Dispatchers.Main) {
|
||||
liveDataTaskUpload.postValue(map)
|
||||
val mDialog = FirstDialog(context)
|
||||
mDialog.setTitle("提示?")
|
||||
mDialog.setMessage("此任务中存在未测评link,请确认!")
|
||||
mDialog.setPositiveButton(
|
||||
"确定"
|
||||
) { _, _ ->
|
||||
mDialog.dismiss()
|
||||
map[taskBean] = true
|
||||
liveDataTaskUpload.postValue(map)
|
||||
}
|
||||
mDialog.setNegativeButton(
|
||||
"取消"
|
||||
) { _, _ -> mDialog.dismiss() }
|
||||
mDialog.show()
|
||||
}
|
||||
}else{
|
||||
map[taskBean] = true
|
||||
liveDataTaskUpload.postValue(map)
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable-xxhdpi/icon_close_catch_line.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/icon_close_catch_line.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_open_catch_line.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/icon_open_catch_line.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
5
app/src/main/res/drawable/selector_catch_line_src.xml
Normal file
5
app/src/main/res/drawable/selector_catch_line_src.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/icon_open_catch_line" android:state_selected="true"></item>
|
||||
<item android:drawable="@drawable/icon_close_catch_line" />
|
||||
</selector>
|
@ -248,13 +248,14 @@
|
||||
app:layout_constraintLeft_toLeftOf="@id/main_activity_top_sign_recyclerview" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_map_update"
|
||||
android:id="@+id/main_activity_map_catch_line"
|
||||
style="@style/zoom_btns_style"
|
||||
android:background="@drawable/selector_road_line_bg"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:onClick="@{(view)->mainActivity.refrushOnclick(view)}"
|
||||
android:src="@drawable/icon_map_refrush"
|
||||
app:layout_constraintBottom_toTopOf="@id/main_activity_zoom_in"
|
||||
app:layout_constraintRight_toRightOf="@id/main_activity_zoom_in" />
|
||||
android:onClick="@{(view)->mainActivity.catchLineOnclick(view)}"
|
||||
android:src="@drawable/selector_catch_line_src"
|
||||
app:layout_constraintBottom_toTopOf="@id/main_activity_location"
|
||||
app:layout_constraintRight_toRightOf="@id/main_activity_location" />
|
||||
|
||||
|
||||
<ImageButton
|
||||
@ -287,8 +288,8 @@
|
||||
android:layout_marginBottom="12dp"
|
||||
android:onClick="@{()->mainActivity.onClickLocation()}"
|
||||
android:src="@drawable/icon_location_north"
|
||||
app:layout_constraintBottom_toTopOf="@id/main_activity_map_update"
|
||||
app:layout_constraintRight_toRightOf="@id/main_activity_map_update" />
|
||||
app:layout_constraintBottom_toTopOf="@id/main_activity_zoom_in"
|
||||
app:layout_constraintRight_toRightOf="@id/main_activity_zoom_in" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_note"
|
||||
@ -296,8 +297,8 @@
|
||||
android:layout_marginBottom="12dp"
|
||||
android:onClick="@{()->mainActivity.onClickNewNote()}"
|
||||
android:src="@drawable/icon_menu_note"
|
||||
app:layout_constraintBottom_toTopOf="@id/main_activity_location"
|
||||
app:layout_constraintRight_toRightOf="@id/main_activity_location" />
|
||||
app:layout_constraintBottom_toTopOf="@id/main_activity_map_catch_line"
|
||||
app:layout_constraintRight_toRightOf="@id/main_activity_map_catch_line" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/main_activity_voice"
|
||||
@ -338,7 +339,7 @@
|
||||
android:id="@+id/main_activity_right_visibility_buttons_group2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="main_activity_close_line,main_activity_select_line,main_activity_voice,main_activity_note,main_activity_map_update,main_activity_zoom_in,main_activity_zoom_out,main_activity_geometry,main_activity_location" />
|
||||
app:constraint_referenced_ids="main_activity_close_line,main_activity_select_line,main_activity_voice,main_activity_note,main_activity_map_catch_line,main_activity_zoom_in,main_activity_zoom_out,main_activity_geometry,main_activity_location" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/main_activity_middle_fragment"
|
||||
|
@ -46,6 +46,11 @@
|
||||
android:icon="@drawable/baseline_person_24"
|
||||
android:visible="true"
|
||||
android:title="锁定地图旋转及视角" />
|
||||
<item
|
||||
android:id="@+id/personal_center_menu_marker"
|
||||
android:icon="@drawable/baseline_person_24"
|
||||
android:visible="true"
|
||||
android:title="隐藏Marker" />
|
||||
<item
|
||||
android:id="@+id/personal_center_menu_catch_all"
|
||||
android:icon="@drawable/baseline_person_24"
|
||||
|
@ -1811,7 +1811,7 @@
|
||||
<!-- 环岛 -->
|
||||
<m v="OMDB_ROUNDABOUT">
|
||||
<line stroke="#fcba5a" width="0.5" />
|
||||
<symbol repeat="false" repeat-start="0" gland="false" repeat-gap="32" src="assets:omdb/icon_2204_0.svg"></symbol>
|
||||
<symbol repeat="false" repeat-start="0" gland="false" repeat-gap="0" src="assets:omdb/icon_2204_0.svg"></symbol>
|
||||
</m>
|
||||
|
||||
<!-- 停止位置 -->
|
||||
|
@ -372,6 +372,11 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
mMapView.updateMap(true)
|
||||
}
|
||||
|
||||
fun setQsRecordMarkEnable(enable:Boolean){
|
||||
qsRecordItemizedLayer.isEnabled = enable
|
||||
mMapView.updateMap(true)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 增加或更新便签
|
||||
|
2
vtm
2
vtm
@ -1 +1 @@
|
||||
Subproject commit 719c44b65d3ed26d725b24b3a5366b281c9e4fad
|
||||
Subproject commit 271e7b22785b0570a34c50476e17a98dfcca7e71
|
Loading…
x
Reference in New Issue
Block a user