Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
@ -100,6 +100,7 @@
|
||||
"code": 2017,
|
||||
"name": "道路施工",
|
||||
"catch":true,
|
||||
"checkLinkId": false,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 17
|
||||
},
|
||||
@ -152,6 +153,7 @@
|
||||
"table": "OMDB_BRIDGE",
|
||||
"code": 2201,
|
||||
"name": "桥",
|
||||
"catch":true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
@ -169,6 +171,7 @@
|
||||
"name": "隧道",
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"catch":true,
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
@ -222,6 +225,7 @@
|
||||
"checkLinkId": false,
|
||||
"zoomMin": 18,
|
||||
"zoomMax": 20,
|
||||
"catch":true,
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
@ -238,6 +242,7 @@
|
||||
"zoomMin": 18,
|
||||
"zoomMax": 20,
|
||||
"is3D": true,
|
||||
"catch":true,
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
@ -344,6 +349,7 @@
|
||||
"table": "OMDB_SPEEDLIMIT_COND",
|
||||
"code": 4003,
|
||||
"name": "条件点限速",
|
||||
"catch":true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
@ -359,6 +365,7 @@
|
||||
"table": "OMDB_SPEEDLIMIT_VAR",
|
||||
"code": 4004,
|
||||
"name": "可变点限速",
|
||||
"catch":true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
@ -543,6 +550,7 @@
|
||||
"table": "OMDB_LANE_LINK_LG",
|
||||
"code": 5001,
|
||||
"name": "车道中心线",
|
||||
"catch":false,
|
||||
"checkLinkId": false,
|
||||
"zoomMin": 18,
|
||||
"zoomMax": 20,
|
||||
@ -565,6 +573,7 @@
|
||||
"code": 2004,
|
||||
"name": "道路属性",
|
||||
"existSubCode": true,
|
||||
"catch":true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
@ -602,6 +611,7 @@
|
||||
"table": "OMDB_ROUNDABOUT",
|
||||
"code": 2204,
|
||||
"name": "环岛",
|
||||
"catch":true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 17,
|
||||
"transformer": [
|
||||
|
@ -53,16 +53,16 @@ class Constant {
|
||||
/**
|
||||
* 当前安装的任务文件
|
||||
*/
|
||||
lateinit var currentInstallTaskFolder:File
|
||||
lateinit var currentInstallTaskFolder: File
|
||||
|
||||
lateinit var currentInstallTaskConfig:RealmConfiguration
|
||||
lateinit var currentInstallTaskConfig: RealmConfiguration
|
||||
|
||||
/**
|
||||
* 当前选择的任务
|
||||
*/
|
||||
lateinit var currentSelectTaskFolder:File
|
||||
lateinit var currentSelectTaskFolder: File
|
||||
|
||||
lateinit var currentSelectTaskConfig:RealmConfiguration
|
||||
lateinit var currentSelectTaskConfig: RealmConfiguration
|
||||
|
||||
/**
|
||||
* 用户附件数据目录
|
||||
@ -90,7 +90,6 @@ class Constant {
|
||||
var INDOOR_IP: String = ""
|
||||
|
||||
|
||||
|
||||
const val DEBUG = true
|
||||
|
||||
/**
|
||||
@ -103,6 +102,16 @@ class Constant {
|
||||
*/
|
||||
var MapRotateEnable = false
|
||||
|
||||
/**
|
||||
* Marker显隐
|
||||
*/
|
||||
var MapMarkerCloseEnable = false
|
||||
|
||||
/**
|
||||
* 是否开启线捕捉
|
||||
*/
|
||||
var MapCatchLine = false
|
||||
|
||||
/**
|
||||
* 全要素捕捉
|
||||
*/
|
||||
@ -145,6 +154,21 @@ class Constant {
|
||||
const val SELECT_TASK_ID = "select_task_id" //选中的任务ID
|
||||
|
||||
const val SHARED_SYNC_TASK_LINK_ID = "shared_sync_task_link_id"//利用shared通知任务页面更新
|
||||
|
||||
/**
|
||||
* 偏离距离 单位:米
|
||||
*/
|
||||
const val NAVI_DEVIATION_DISTANCE = "navi_deviation_distance"
|
||||
|
||||
/**
|
||||
* 偏离次数上限
|
||||
*/
|
||||
const val NAVI_DEVIATION_COUNT = "navi_deviation_count"
|
||||
|
||||
/**
|
||||
* 最远显示距离 米
|
||||
*/
|
||||
const val NAVI_FARTHEST_DISPLAY_DISTANCE = "navi_farthest_display_distance"
|
||||
}
|
||||
|
||||
|
||||
|
26
app/src/main/java/com/navinfo/omqs/bean/ScWarningCodeBean.kt
Normal file
@ -0,0 +1,26 @@
|
||||
package com.navinfo.omqs.bean
|
||||
|
||||
import android.os.Parcelable
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Entity(tableName = "ScWarningCode")
|
||||
@Parcelize
|
||||
data class ScWarningCodeBean(
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
var id: Long = 0,
|
||||
/**
|
||||
* code
|
||||
* 编码
|
||||
*/
|
||||
@ColumnInfo("CODE")
|
||||
val code: String = "",
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
@ColumnInfo("DESCRIBE")
|
||||
val describe: String = "",
|
||||
|
||||
) : Parcelable
|
@ -9,7 +9,7 @@ data class SignBean(
|
||||
//图标ID
|
||||
var iconId: Int = 0,
|
||||
//定位点到目标距离
|
||||
val distance: Int = 0,
|
||||
var distance: Int = 0,
|
||||
//左上图标中的文字
|
||||
val iconText: String = "",
|
||||
//绑定的linkid
|
||||
|
@ -6,7 +6,6 @@ import com.navinfo.collect.library.data.entity.RenderEntity
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.omqs.Constant
|
||||
import io.realm.Realm
|
||||
import io.realm.RealmConfiguration
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import org.locationtech.jts.algorithm.Angle
|
||||
@ -583,9 +582,9 @@ class ImportPreProcess {
|
||||
angleReference.renderEntityId = renderEntity.id
|
||||
angleReference.name = "${renderEntity.name}车道中线面"
|
||||
angleReference.table = renderEntity.table
|
||||
angleReference.geometry = renderEntity.geometry
|
||||
angleReference.geometry = GeometryTools.computeLine(0.00002,0.00002,renderEntity.geometry)
|
||||
angleReference.properties["qi_table"] = renderEntity.table
|
||||
angleReference.properties["width"] = "3"
|
||||
angleReference.properties["widthProperties"] = "3"
|
||||
angleReference.zoomMin = renderEntity.zoomMin
|
||||
angleReference.zoomMax = renderEntity.zoomMax
|
||||
angleReference.taskId = renderEntity.taskId
|
||||
|
@ -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 {
|
||||
|
@ -6,17 +6,20 @@ import com.navinfo.collect.library.data.entity.NiLocation
|
||||
import com.navinfo.omqs.bean.OfflineMapCityBean
|
||||
import com.navinfo.omqs.bean.ScProblemTypeBean
|
||||
import com.navinfo.omqs.bean.ScRootCauseAnalysisBean
|
||||
import com.navinfo.omqs.bean.ScWarningCodeBean
|
||||
import com.navinfo.omqs.db.dao.OfflineMapDao
|
||||
import com.navinfo.omqs.db.dao.ScProblemTypeDao
|
||||
import com.navinfo.omqs.db.dao.ScRootCauseAnalysisDao
|
||||
import com.navinfo.omqs.db.dao.ScWarningCodeDao
|
||||
|
||||
@Database(
|
||||
entities = [OfflineMapCityBean::class, ScProblemTypeBean::class, ScRootCauseAnalysisBean::class],
|
||||
version = 1,
|
||||
entities = [OfflineMapCityBean::class, ScProblemTypeBean::class, ScRootCauseAnalysisBean::class, ScWarningCodeBean::class],
|
||||
version = 2,
|
||||
exportSchema = false
|
||||
)
|
||||
abstract class RoomAppDatabase : RoomDatabase() {
|
||||
abstract fun getOfflineMapDao(): OfflineMapDao
|
||||
abstract fun getScProblemTypeDao(): ScProblemTypeDao
|
||||
abstract fun getScRootCauseAnalysisDao(): ScRootCauseAnalysisDao
|
||||
abstract fun getScWarningCodeDao(): ScWarningCodeDao
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.navinfo.omqs.db.dao
|
||||
|
||||
import androidx.room.*
|
||||
import com.navinfo.omqs.bean.ScProblemTypeBean
|
||||
import com.navinfo.omqs.bean.ScWarningCodeBean
|
||||
|
||||
|
||||
@Dao
|
||||
interface ScWarningCodeDao {
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertList(list: List<ScWarningCodeBean>)
|
||||
|
||||
|
||||
@Query("delete from ScWarningCode")
|
||||
suspend fun deleteAll()
|
||||
|
||||
/**
|
||||
* 更新整个数据库表,由于没有
|
||||
*/
|
||||
@Transaction
|
||||
suspend fun insertOrUpdateList(list: List<ScWarningCodeBean>) {
|
||||
//先删除
|
||||
deleteAll()
|
||||
//后插入
|
||||
insertList(list)
|
||||
}
|
||||
|
||||
@Query("select DESCRIBE from ScWarningCode where CODE=:code")
|
||||
suspend fun findScWarningDescribe(code: String): String?
|
||||
|
||||
}
|
@ -125,10 +125,13 @@ class TaskUploadScope(
|
||||
}
|
||||
|
||||
taskBean.hadLinkDvoList.forEach { hadLinkDvoBean ->
|
||||
Log.e("jingo", "数据上传遍历开始")
|
||||
|
||||
val linkStatus = 1
|
||||
//存在原因标记未测评
|
||||
if (hadLinkDvoBean.reason.isNotEmpty()) {
|
||||
Log.e("jingo", "数据上传遍历开始0${hadLinkDvoBean.linkPid}")
|
||||
|
||||
//未测评
|
||||
val linkStatus = 0
|
||||
|
||||
@ -160,6 +163,8 @@ class TaskUploadScope(
|
||||
|
||||
} else {
|
||||
|
||||
Log.e("jingo", "数据上传遍历开始1${hadLinkDvoBean.linkPid}")
|
||||
|
||||
val linkStatus = hadLinkDvoBean.linkStatus
|
||||
|
||||
var s: String = "%.3f".format(hadLinkDvoBean.length)//保留一位小数(且支持四舍五入)
|
||||
@ -221,8 +226,9 @@ class TaskUploadScope(
|
||||
}
|
||||
}
|
||||
}
|
||||
realm.close()
|
||||
Log.e("jingo", "数据上传遍历结束")
|
||||
}
|
||||
realm.close()
|
||||
|
||||
if (bodyList.size > 0) {
|
||||
val result = uploadManager.netApi.postRequest(bodyList)// .enqueue(object :
|
||||
|
@ -13,7 +13,12 @@ class MetadataUtils {
|
||||
|
||||
object ScRootCauseAnalysisTitle {
|
||||
const val TITLE_PROBLEM_LINK = "问题环节"
|
||||
const val TITLE_PROBLEM_CAUSE = "初步问题原因"
|
||||
const val TITLE_PROBLEM_CAUSE = "初步分析"
|
||||
}
|
||||
|
||||
object ScWarningCodeTitle{
|
||||
const val TITLE_CODE = "编码"
|
||||
const val TITLE_DESCRIBE = "描述"
|
||||
}
|
||||
}
|
||||
}
|
@ -40,7 +40,13 @@ class LoginActivity : CheckPermissionsActivity() {
|
||||
binding.activity = this
|
||||
initView()
|
||||
Log.e("jingo", getScreenParams())
|
||||
UMConfigure.init(this, "650bece7b2f6fa00ba573c7a", "native", UMConfigure.DEVICE_TYPE_PHONE, "")
|
||||
UMConfigure.init(
|
||||
this,
|
||||
"650bece7b2f6fa00ba573c7a",
|
||||
"native",
|
||||
UMConfigure.DEVICE_TYPE_PHONE,
|
||||
""
|
||||
)
|
||||
}
|
||||
|
||||
private fun getScreenParams(): String {
|
||||
|
@ -14,6 +14,7 @@ import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity
|
||||
import com.navinfo.collect.library.data.entity.TaskBean
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.bean.LoginUserBean
|
||||
import com.navinfo.omqs.bean.SysUserBean
|
||||
@ -132,6 +133,7 @@ class LoginViewModel @Inject constructor(
|
||||
}
|
||||
//不指定IO,会在主线程里运行
|
||||
jobLogin = viewModelScope.launch(Dispatchers.IO) {
|
||||
//Log.e("qj", "computeline==${GeometryTools.computeLine(0.003,0.003,"LINESTRING(116.2730063860964 40.09052257957624 36.75, 116.27376497186042 40.090072453495395 38.34, 116.27413076766412 40.089855289361786 39.01, 116.27417239035157 40.08983061650492 39.15, 116.27466896728139 40.089535645040385 39.99, 116.2751211296483 40.089267551829636 40.67, 116.27545352868347 40.089070581974944 40.98, 116.27589660200627 40.088807594767246 41.28, 116.27604819769634 40.088718103405185 41.34, 116.27667570485863 40.08834486145473 41.43, 116.2770275412774 40.08813642434714 41.36, 116.27745673745146 40.087882150865546 41.14, 116.27778797172138 40.08768490714857 40.89, 116.2781675465249 40.087459905560266 40.45, 116.2783819045443 40.087332076220086 40.02, 116.27880692426884 40.0870801193608 39.32, 116.27943180930261 40.08670963506418 38.04, 116.27977508323622 40.08650562397605 37.39, 116.28016410016664 40.08627485623695 36.77, 116.28057924586821 40.0860283164225 36.29)")}")
|
||||
loginCheck(context, userName, password)
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
package com.navinfo.omqs.ui.activity.map
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
@ -11,7 +8,6 @@ import android.speech.tts.TextToSpeech
|
||||
import android.util.Log
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.View.OnLongClickListener
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
@ -20,6 +16,8 @@ import androidx.activity.viewModels
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import androidx.navigation.Navigation
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -27,9 +25,9 @@ import com.blankj.utilcode.util.ClipboardUtils
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity
|
||||
import com.navinfo.collect.library.data.entity.TaskBean
|
||||
import com.navinfo.collect.library.map.NIMapController
|
||||
import com.navinfo.collect.library.map.handler.MeasureLayerHandler
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.bean.ImportConfig
|
||||
@ -39,7 +37,6 @@ import com.navinfo.omqs.databinding.ActivityMainBinding
|
||||
import com.navinfo.omqs.http.offlinemapdownload.OfflineMapDownloadManager
|
||||
import com.navinfo.omqs.tools.LayerConfigUtils
|
||||
import com.navinfo.omqs.ui.activity.BaseActivity
|
||||
import com.navinfo.omqs.ui.dialog.LoadingDialog
|
||||
import com.navinfo.omqs.ui.fragment.console.ConsoleFragment
|
||||
import com.navinfo.omqs.ui.fragment.itemlist.ItemListFragment
|
||||
import com.navinfo.omqs.ui.fragment.offlinemap.OfflineMapFragment
|
||||
@ -53,6 +50,8 @@ import com.navinfo.omqs.util.NaviStatus
|
||||
import com.navinfo.omqs.util.SignUtil
|
||||
import com.navinfo.omqs.util.SpeakMode
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import org.oscim.core.GeoPoint
|
||||
import org.oscim.renderer.GLViewport
|
||||
@ -350,29 +349,27 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
viewModel.liveDataSignMoreInfo.observe(this) {
|
||||
val fragment =
|
||||
supportFragmentManager.findFragmentById(R.id.main_activity_sign_more_info_fragment)
|
||||
if (fragment == null) {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.main_activity_sign_more_info_fragment, SignMoreInfoFragment())
|
||||
.commit()
|
||||
|
||||
if(!rightController.backQueue.isEmpty()){
|
||||
rightController.navigateUp()
|
||||
}
|
||||
|
||||
lifecycleScope.launch{
|
||||
delay(100)
|
||||
val fragment =
|
||||
supportFragmentManager.findFragmentById(R.id.main_activity_sign_more_info_fragment)
|
||||
if (fragment == null) {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.main_activity_sign_more_info_fragment, SignMoreInfoFragment())
|
||||
.commit()
|
||||
}else{
|
||||
supportFragmentManager.beginTransaction().add(R.id.main_activity_sign_more_info_fragment, SignMoreInfoFragment()).commit()
|
||||
}
|
||||
val bundle = Bundle()
|
||||
bundle.putParcelable("SignBean", it)
|
||||
bundle.putBoolean("AutoSave", false)
|
||||
rightController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||
}
|
||||
//启动问题记录
|
||||
val signBean = SignBean(
|
||||
iconId = SignUtil.getSignIcon(it),
|
||||
iconText = SignUtil.getSignIconText(it),
|
||||
linkId = it.properties[RenderEntity.Companion.LinkTable.linkPid]
|
||||
?: "",
|
||||
name = SignUtil.getSignNameText(it),
|
||||
bottomRightText = SignUtil.getSignBottomRightText(it),
|
||||
renderEntity = it,
|
||||
isMoreInfo = SignUtil.isMoreInfo(it),
|
||||
index = SignUtil.getRoadInfoIndex(it)
|
||||
)
|
||||
val bundle = Bundle()
|
||||
bundle.putParcelable("SignBean", signBean)
|
||||
bundle.putBoolean("AutoSave", false)
|
||||
rightController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||
}
|
||||
|
||||
viewModel.liveIndoorToolsResp.observe(this) {
|
||||
@ -781,17 +778,20 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新地图
|
||||
* 线捕捉开关
|
||||
*/
|
||||
fun refrushOnclick(view: View) {
|
||||
mapController.layerManagerHandler.updateOMDBVectorTileLayer()
|
||||
fun catchLineOnclick(view: View) {
|
||||
viewModel.setCatchRoad(!viewModel.isCatchRoad())
|
||||
binding.mainActivityMapCatchLine.isSelected = viewModel.isCatchRoad()
|
||||
}
|
||||
|
||||
/**
|
||||
* zoomin
|
||||
*/
|
||||
fun zoomInOnclick(view: View) {
|
||||
mapController.animationHandler.zoomIn()
|
||||
Log.e("qj", "computeline==${GeometryTools.computeLine(0.00003,0.00003,"LINESTRING(116.2730063860964 40.09052257957624 36.75, 116.27376497186042 40.090072453495395 38.34, 116.27413076766412 40.089855289361786 39.01, 116.27417239035157 40.08983061650492 39.15, 116.27466896728139 40.089535645040385 39.99, 116.2751211296483 40.089267551829636 40.67, 116.27545352868347 40.089070581974944 40.98, 116.27589660200627 40.088807594767246 41.28, 116.27604819769634 40.088718103405185 41.34, 116.27667570485863 40.08834486145473 41.43, 116.2770275412774 40.08813642434714 41.36, 116.27745673745146 40.087882150865546 41.14, 116.27778797172138 40.08768490714857 40.89, 116.2781675465249 40.087459905560266 40.45, 116.2783819045443 40.087332076220086 40.02, 116.27880692426884 40.0870801193608 39.32, 116.27943180930261 40.08670963506418 38.04, 116.27977508323622 40.08650562397605 37.39, 116.28016410016664 40.08627485623695 36.77, 116.28057924586821 40.0860283164225 36.29)")}")
|
||||
|
||||
//mapController.animationHandler.zoomIn()
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,6 +37,7 @@ import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.bean.*
|
||||
import com.navinfo.omqs.db.RealmOperateHelper
|
||||
import com.navinfo.omqs.db.RoomAppDatabase
|
||||
import com.navinfo.omqs.http.NetResult
|
||||
import com.navinfo.omqs.http.NetworkService
|
||||
import com.navinfo.omqs.tools.FileManager
|
||||
@ -56,8 +57,10 @@ import kotlinx.coroutines.flow.flow
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.locationtech.jts.geom.Envelope
|
||||
import org.locationtech.jts.geom.Geometry
|
||||
import org.locationtech.jts.geom.LineString
|
||||
import org.locationtech.spatial4j.shape.Rectangle
|
||||
import org.oscim.core.GeoPoint
|
||||
import org.oscim.core.MapPosition
|
||||
import org.oscim.map.Map
|
||||
@ -78,7 +81,8 @@ class MainViewModel @Inject constructor(
|
||||
private val traceDataBase: TraceDataBase,
|
||||
private val realmOperateHelper: RealmOperateHelper,
|
||||
private val networkService: NetworkService,
|
||||
private val sharedPreferences: SharedPreferences
|
||||
private val sharedPreferences: SharedPreferences,
|
||||
val roomAppDatabase: RoomAppDatabase
|
||||
) : ViewModel(), SocketServer.OnConnectSinsListener,
|
||||
SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
@ -113,7 +117,7 @@ class MainViewModel @Inject constructor(
|
||||
/**
|
||||
* 当前选中的要展示的详细信息的要素
|
||||
*/
|
||||
val liveDataSignMoreInfo = MutableLiveData<RenderEntity>()
|
||||
val liveDataSignMoreInfo = MutableLiveData<SignBean>()
|
||||
|
||||
/**
|
||||
* 捕捉到的itemList
|
||||
@ -180,6 +184,11 @@ class MainViewModel @Inject constructor(
|
||||
*/
|
||||
private var bHighRoad = true
|
||||
|
||||
/**
|
||||
* 是不是捕捉线
|
||||
*/
|
||||
private var bCatchRoad = false
|
||||
|
||||
/**
|
||||
* 是不是选择轨迹点
|
||||
*/
|
||||
@ -379,8 +388,23 @@ class MainViewModel @Inject constructor(
|
||||
naviMutex.lock()
|
||||
getTaskBean()
|
||||
if (currentTaskBean != null && currentTaskBean!!.status == FileManager.Companion.FileDownloadStatus.DONE) {
|
||||
val naviOption = NaviOption(
|
||||
deviationCount = sharedPreferences.getInt(
|
||||
Constant.NAVI_DEVIATION_COUNT,
|
||||
3
|
||||
),
|
||||
deviationDistance = sharedPreferences.getInt(
|
||||
Constant.NAVI_DEVIATION_DISTANCE,
|
||||
15
|
||||
),
|
||||
farthestDisplayDistance = sharedPreferences.getInt(
|
||||
Constant.NAVI_FARTHEST_DISPLAY_DISTANCE,
|
||||
500
|
||||
)
|
||||
)
|
||||
naviEngine = NaviEngine(niMapController = mapController,
|
||||
realmOperateHelper = realmOperateHelper,
|
||||
naviOption = naviOption,
|
||||
callback = object : OnNaviEngineCallbackListener {
|
||||
|
||||
override fun planningPathStatus(status: NaviStatus) {
|
||||
@ -403,20 +427,12 @@ class MainViewModel @Inject constructor(
|
||||
) {
|
||||
val signList = mutableListOf<SignBean>()
|
||||
for (naviRouteItem in list) {
|
||||
|
||||
val signBean = SignBean(
|
||||
iconId = SignUtil.getSignIcon(naviRouteItem.data),
|
||||
iconText = SignUtil.getSignIconText(naviRouteItem.data),
|
||||
linkId = naviRouteItem.linkId,
|
||||
distance = naviRouteItem.distance,
|
||||
name = SignUtil.getSignNameText(naviRouteItem.data),
|
||||
bottomRightText = SignUtil.getSignBottomRightText(
|
||||
naviRouteItem.data
|
||||
),
|
||||
renderEntity = naviRouteItem.data,
|
||||
isMoreInfo = SignUtil.isMoreInfo(naviRouteItem.data),
|
||||
index = SignUtil.getRoadInfoIndex(naviRouteItem.data)
|
||||
val signBean = SignUtil.createSignBean(
|
||||
viewModelScope,
|
||||
roomAppDatabase,
|
||||
naviRouteItem.data
|
||||
)
|
||||
signBean.distance = naviRouteItem.distance
|
||||
signList.add(signBean)
|
||||
}
|
||||
if (route != null) {
|
||||
@ -436,13 +452,36 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
|
||||
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences, key: String) {
|
||||
if (key == Constant.SELECT_TASK_ID) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
naviMutex.lock()
|
||||
naviEngineStatus = 0
|
||||
getTaskBean()
|
||||
initQsRecordData()
|
||||
naviMutex.unlock()
|
||||
when (key) {
|
||||
Constant.SELECT_TASK_ID -> {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
naviMutex.lock()
|
||||
naviEngineStatus = 0
|
||||
getTaskBean()
|
||||
initQsRecordData()
|
||||
naviMutex.unlock()
|
||||
}
|
||||
}
|
||||
Constant.NAVI_DEVIATION_COUNT,
|
||||
Constant.NAVI_FARTHEST_DISPLAY_DISTANCE,
|
||||
Constant.NAVI_DEVIATION_DISTANCE -> {
|
||||
if (naviEngine != null) {
|
||||
val naviOption = NaviOption(
|
||||
deviationCount = sharedPreferences.getInt(
|
||||
Constant.NAVI_DEVIATION_COUNT,
|
||||
3
|
||||
),
|
||||
deviationDistance = sharedPreferences.getInt(
|
||||
Constant.NAVI_DEVIATION_DISTANCE,
|
||||
15
|
||||
),
|
||||
farthestDisplayDistance = sharedPreferences.getInt(
|
||||
Constant.NAVI_FARTHEST_DISPLAY_DISTANCE,
|
||||
500
|
||||
)
|
||||
)
|
||||
naviEngine!!.naviOption = naviOption
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -597,11 +636,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 {
|
||||
@ -613,7 +656,8 @@ class MainViewModel @Inject constructor(
|
||||
}
|
||||
}.toList()
|
||||
if (filterResult.size == 1) {
|
||||
liveDataSignMoreInfo.postValue(filterResult[0])
|
||||
val bean = SignUtil.createSignBean(viewModelScope, roomAppDatabase, filterResult[0])
|
||||
liveDataSignMoreInfo.postValue(bean)
|
||||
} else {
|
||||
liveDataItemList.postValue(filterResult)
|
||||
}
|
||||
@ -642,15 +686,10 @@ class MainViewModel @Inject constructor(
|
||||
DataCodeEnum.OMDB_MULTI_DIGITIZED.code,//上下线分离
|
||||
DataCodeEnum.OMDB_CON_ACCESS.code,//全封闭
|
||||
-> {
|
||||
val signBean = SignBean(
|
||||
iconId = SignUtil.getSignIcon(element),
|
||||
iconText = SignUtil.getSignIconText(element),
|
||||
linkId = route.linkId,
|
||||
name = SignUtil.getSignNameText(element),
|
||||
bottomRightText = SignUtil.getSignBottomRightText(element),
|
||||
renderEntity = element,
|
||||
isMoreInfo = SignUtil.isMoreInfo(element),
|
||||
index = SignUtil.getRoadInfoIndex(element)
|
||||
val signBean = SignUtil.createSignBean(
|
||||
viewModelScope,
|
||||
roomAppDatabase,
|
||||
element
|
||||
)
|
||||
if (signBean.iconText != "") {
|
||||
topSignList.add(
|
||||
@ -690,17 +729,11 @@ class MainViewModel @Inject constructor(
|
||||
DataCodeEnum.OMDB_LINK_FORM2_13.code,
|
||||
DataCodeEnum.OMDB_VIADUCT.code,
|
||||
-> {
|
||||
val signBean = SignBean(
|
||||
iconId = SignUtil.getSignIcon(element),
|
||||
iconText = SignUtil.getSignIconText(element),
|
||||
linkId = route.linkId,
|
||||
name = SignUtil.getSignNameText(element),
|
||||
bottomRightText = SignUtil.getSignBottomRightText(element),
|
||||
renderEntity = element,
|
||||
isMoreInfo = SignUtil.isMoreInfo(element),
|
||||
index = SignUtil.getRoadInfoIndex(element),
|
||||
|
||||
)
|
||||
val signBean = SignUtil.createSignBean(
|
||||
viewModelScope,
|
||||
roomAppDatabase,
|
||||
element
|
||||
)
|
||||
topSignList.add(
|
||||
signBean
|
||||
)
|
||||
@ -756,11 +789,14 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
val linePoints = GeometryTools.getGeoPoints(link.geometry)
|
||||
val direct = link.properties["direct"]
|
||||
if(direct == "3"){
|
||||
if (direct == "3") {
|
||||
linePoints.reverse()
|
||||
}
|
||||
|
||||
val footAndDistance = GeometryTools.pointToLineDistance(point, GeometryTools.createLineString(linePoints))
|
||||
val footAndDistance = GeometryTools.pointToLineDistance(
|
||||
point,
|
||||
GeometryTools.createLineString(linePoints)
|
||||
)
|
||||
linePoints.add(
|
||||
footAndDistance.footIndex + 1,
|
||||
GeoPoint(
|
||||
@ -778,21 +814,15 @@ class MainViewModel @Inject constructor(
|
||||
liveDataRoadName.postValue(element)
|
||||
continue
|
||||
}
|
||||
|
||||
val signBean = SignBean(
|
||||
iconId = SignUtil.getSignIcon(element),
|
||||
iconText = SignUtil.getSignIconText(element),
|
||||
linkId = linkId,
|
||||
name = SignUtil.getSignNameText(element),
|
||||
bottomRightText = SignUtil.getSignBottomRightText(element),
|
||||
renderEntity = element,
|
||||
isMoreInfo = SignUtil.isMoreInfo(element),
|
||||
index = SignUtil.getRoadInfoIndex(element),
|
||||
distance = SignUtil.getDistance(
|
||||
footAndDistance,
|
||||
newLineString,
|
||||
element
|
||||
)
|
||||
val signBean = SignUtil.createSignBean(
|
||||
viewModelScope,
|
||||
roomAppDatabase,
|
||||
element
|
||||
)
|
||||
signBean.distance = SignUtil.getDistance(
|
||||
footAndDistance,
|
||||
newLineString,
|
||||
element
|
||||
)
|
||||
// Log.e("jingo", "捕捉到的数据code ${element.code}")
|
||||
when (element.code) {
|
||||
@ -810,6 +840,7 @@ class MainViewModel @Inject constructor(
|
||||
DataCodeEnum.OMDB_RD_LINK_KIND.code,//种别,
|
||||
DataCodeEnum.OMDB_RD_LINK_FUNCTION_CLASS.code, // 功能等级,
|
||||
DataCodeEnum.OMDB_LINK_SPEEDLIMIT.code, //线限速,
|
||||
DataCodeEnum.OMDB_LINK_SPEEDLIMIT_COND.code,//条件线限速
|
||||
DataCodeEnum.OMDB_LINK_DIRECT.code,//道路方向,
|
||||
DataCodeEnum.OMDB_RAMP.code, //匝道
|
||||
DataCodeEnum.OMDB_BRIDGE.code,//桥
|
||||
@ -1118,6 +1149,14 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启捕捉线
|
||||
*/
|
||||
fun setCatchRoad(select: Boolean) {
|
||||
bCatchRoad = select
|
||||
Constant.MapCatchLine = bCatchRoad
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否开启线高亮
|
||||
*/
|
||||
@ -1125,6 +1164,13 @@ class MainViewModel @Inject constructor(
|
||||
return bHighRoad
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否开启捕捉线
|
||||
*/
|
||||
fun isCatchRoad(): Boolean {
|
||||
return bCatchRoad
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启轨迹选择
|
||||
*/
|
||||
@ -1172,7 +1218,16 @@ class MainViewModel @Inject constructor(
|
||||
*/
|
||||
|
||||
fun showSignMoreInfo(data: RenderEntity) {
|
||||
liveDataSignMoreInfo.value = data
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
liveDataSignMoreInfo.postValue(
|
||||
SignUtil.createSignBean(
|
||||
viewModelScope,
|
||||
roomAppDatabase,
|
||||
data
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (data.wkt != null) {
|
||||
mapController.markerHandle.removeMarker("moreInfo")
|
||||
mapController.lineHandler.removeLine()
|
||||
@ -1487,10 +1542,20 @@ class MainViewModel @Inject constructor(
|
||||
when (searchEnum) {
|
||||
SearchEnum.LINK -> {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
Log.e("jingo", "查询link $msg")
|
||||
val link = realmOperateHelper.queryLink(linkPid = msg)
|
||||
if (link != null) {
|
||||
link?.let { l ->
|
||||
mapController.lineHandler.showLine(l.geometry)
|
||||
Log.e("jingo", "查询link ${link.geometry}")
|
||||
val lineString = GeometryTools.createGeometry(link.geometry)
|
||||
val envelope = lineString.envelopeInternal
|
||||
withContext(Dispatchers.Main) {
|
||||
mapController.animationHandler.animateToBox(
|
||||
envelope.maxX,
|
||||
envelope.maxY,
|
||||
envelope.minX,
|
||||
envelope.minY
|
||||
)
|
||||
mapController.lineHandler.showLine(link.geometry)
|
||||
dialog.dismiss()
|
||||
}
|
||||
} else {
|
||||
@ -1507,15 +1572,13 @@ class MainViewModel @Inject constructor(
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val qsRecordBean = realmOperateHelper.queryQcRecordBean(markId = msg)
|
||||
if (qsRecordBean != null) {
|
||||
qsRecordBean?.let { l ->
|
||||
val naviController =
|
||||
(mapController.mMapView.context as Activity).findNavController(R.id.main_activity_right_fragment)
|
||||
val bundle = Bundle()
|
||||
bundle.putString("QsId", l.id)
|
||||
naviController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||
ToastUtils.showLong(l.classType)
|
||||
dialog.dismiss()
|
||||
}
|
||||
val naviController =
|
||||
(mapController.mMapView.context as Activity).findNavController(R.id.main_activity_right_fragment)
|
||||
val bundle = Bundle()
|
||||
bundle.putString("QsId", qsRecordBean.id)
|
||||
naviController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||
ToastUtils.showLong(qsRecordBean.classType)
|
||||
dialog.dismiss()
|
||||
} else {
|
||||
withContext(Dispatchers.Main) {
|
||||
Toast.makeText(
|
||||
|
@ -18,6 +18,7 @@ import com.navinfo.omqs.databinding.FragmentConsoleBinding
|
||||
import com.navinfo.omqs.ui.activity.map.MainActivity
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.fragment.layermanager.LayerManagerFragment
|
||||
import com.navinfo.omqs.ui.fragment.navi.NaviSettingFragment
|
||||
import com.navinfo.omqs.ui.fragment.personalcenter.PersonalCenterFragment
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@ -290,7 +291,23 @@ class ConsoleFragment : BaseFragment(), OnClickListener {
|
||||
* 路径规划
|
||||
*/
|
||||
R.id.console_route_bg, R.id.console_route_icon_bg -> {
|
||||
Toast.makeText(requireContext(), "功能开发中", Toast.LENGTH_SHORT).show()
|
||||
// Toast.makeText(requireContext(), "功能开发中", Toast.LENGTH_SHORT).show()
|
||||
if (sceneFlag) {
|
||||
mFragment = NaviSettingFragment {
|
||||
TransitionManager.go(aScene, aTransition)
|
||||
}
|
||||
sceneFlag = false
|
||||
TransitionManager.go(bScene, bTransition)
|
||||
} else {
|
||||
if (mFragment !is NaviSettingFragment) {
|
||||
mFragment = NaviSettingFragment {
|
||||
TransitionManager.go(aScene, aTransition)
|
||||
}
|
||||
childFragmentManager.beginTransaction().replace(fragmentId, mFragment!!)
|
||||
.commit()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
|
@ -89,6 +89,7 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
|
||||
//返回按钮点击
|
||||
binding.evaluationBar.setOnClickListener {
|
||||
it.isEnabled = false
|
||||
val mDialog = FirstDialog(context)
|
||||
mDialog.setTitle("提示?")
|
||||
mDialog.setMessage("是否退出,请确认!")
|
||||
@ -98,7 +99,10 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
mDialog.dismiss()
|
||||
onBackPressed()
|
||||
}
|
||||
mDialog.setNegativeButton("取消", null)
|
||||
mDialog.setNegativeButton("取消") { _, _ ->
|
||||
mDialog.dismiss()
|
||||
it.isEnabled = true
|
||||
}
|
||||
mDialog.show()
|
||||
}
|
||||
|
||||
@ -199,7 +203,7 @@ class EvaluationResultFragment : BaseFragment(), View.OnClickListener {
|
||||
viewModel.liveDataToastMessage.observe(viewLifecycleOwner) {
|
||||
Toast.makeText(requireContext(), it, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
viewModel.liveDataQsRecordBean.observe(viewLifecycleOwner){
|
||||
viewModel.liveDataQsRecordBean.observe(viewLifecycleOwner) {
|
||||
binding.evaluationId.text = it.id
|
||||
}
|
||||
|
||||
|
@ -184,8 +184,8 @@ class EvaluationResultViewModel @Inject constructor(
|
||||
if (linkId.isNotEmpty()) {
|
||||
viewModelScope.launch {
|
||||
val link = realmOperateHelper.queryLink(linkId)
|
||||
link?.let { l ->
|
||||
mapController.lineHandler.showLine(l.geometry)
|
||||
if(link != null){
|
||||
mapController.lineHandler.showLine(link.geometry)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
package com.navinfo.omqs.ui.fragment.navi
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.viewModels
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.databinding.FragmentNaviSettingBinding
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class NaviSettingFragment(private var backListener: (() -> Unit?)? = null) : BaseFragment() {
|
||||
private var _binding: FragmentNaviSettingBinding? = null
|
||||
|
||||
@Inject
|
||||
lateinit var sharedPreferences: SharedPreferences
|
||||
|
||||
private val binding get() = _binding!!
|
||||
private val viewModel by viewModels<NaviSettingViewModel>()
|
||||
|
||||
// private val viewModel by lazy { viewModels<EvaluationResultViewModel>().value}
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = FragmentNaviSettingBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
binding.offCount.setValue(sharedPreferences.getInt(Constant.NAVI_DEVIATION_COUNT,3))
|
||||
binding.offDistance.setValue(sharedPreferences.getInt(Constant.NAVI_DEVIATION_DISTANCE,15))
|
||||
binding.tipsDistance.setValue(sharedPreferences.getInt(Constant.NAVI_FARTHEST_DISPLAY_DISTANCE,500))
|
||||
|
||||
binding.imgConfirm.setOnClickListener{
|
||||
sharedPreferences.edit()
|
||||
.putInt(Constant.NAVI_DEVIATION_DISTANCE,binding.offDistance.getValue())
|
||||
.putInt(Constant.NAVI_DEVIATION_COUNT,binding.offCount.getValue())
|
||||
.putInt(Constant.NAVI_FARTHEST_DISPLAY_DISTANCE,binding.tipsDistance.getValue())
|
||||
.commit()
|
||||
backListener?.invoke()
|
||||
}
|
||||
|
||||
binding.imgBack.setOnClickListener {
|
||||
backListener?.invoke()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package com.navinfo.omqs.ui.fragment.navi
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
|
||||
class NaviSettingViewModel : ViewModel() {
|
||||
}
|
@ -153,6 +153,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) {
|
||||
@ -221,6 +232,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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,11 @@ import com.google.gson.Gson
|
||||
import com.navinfo.collect.library.data.entity.*
|
||||
import com.navinfo.omqs.bean.ScProblemTypeBean
|
||||
import com.navinfo.omqs.bean.ScRootCauseAnalysisBean
|
||||
import com.navinfo.omqs.bean.ScWarningCodeBean
|
||||
import com.navinfo.omqs.db.ImportOMDBHelper
|
||||
import com.navinfo.omqs.db.RealmOperateHelper
|
||||
import com.navinfo.omqs.db.RoomAppDatabase
|
||||
import com.navinfo.omqs.tools.MetadataUtils.Companion.ScProblemTypeTitle
|
||||
import com.navinfo.omqs.tools.MetadataUtils.Companion.ScRootCauseAnalysisTitle
|
||||
import com.navinfo.omqs.tools.MetadataUtils
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
@ -134,7 +134,7 @@ class PersonalCenterViewModel @Inject constructor(
|
||||
hadSpeedLimitVarFile, gson.toJson(hadSpeedlimitVar) + "\r", true
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ZipUtils.zipFiles(
|
||||
@ -154,7 +154,7 @@ class PersonalCenterViewModel @Inject constructor(
|
||||
/**
|
||||
* 导入OMDB数据
|
||||
* */
|
||||
fun importOMDBData(importOMDBHelper: ImportOMDBHelper, task: TaskBean? =null) {
|
||||
fun importOMDBData(importOMDBHelper: ImportOMDBHelper, task: TaskBean? = null) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
Log.d("OMQSApplication", "开始导入数据")
|
||||
if (task != null) {
|
||||
@ -192,35 +192,45 @@ class PersonalCenterViewModel @Inject constructor(
|
||||
var phenomenonIndex = -1
|
||||
var problemLinkIndex = -1
|
||||
var problemCauseIndex = -1
|
||||
var warningCodeIndex = -1
|
||||
var warningDescribeIndex = -1
|
||||
val list = mutableListOf<ScProblemTypeBean>()
|
||||
val list2 = mutableListOf<ScRootCauseAnalysisBean>()
|
||||
val list3 = mutableListOf<ScWarningCodeBean>()
|
||||
while (bufferedReader.readLine()?.also { line = it } != null) { // 处理 CSV 文件中的每一行数据
|
||||
val data =
|
||||
line!!.split(",".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||
if (index == 0) {
|
||||
for (i in data.indices) {
|
||||
when (data[i]) {
|
||||
ScProblemTypeTitle.TITLE_ELEMENT_TYPE -> {
|
||||
MetadataUtils.Companion.ScProblemTypeTitle.TITLE_ELEMENT_TYPE -> {
|
||||
elementTypeIndex = i
|
||||
}
|
||||
ScProblemTypeTitle.TITLE_ELEMENT_CODE -> {
|
||||
MetadataUtils.Companion.ScProblemTypeTitle.TITLE_ELEMENT_CODE -> {
|
||||
elementCodeIndex = i
|
||||
}
|
||||
ScProblemTypeTitle.TITLE_CLASS_TYPE -> {
|
||||
MetadataUtils.Companion.ScProblemTypeTitle.TITLE_CLASS_TYPE -> {
|
||||
classTypeIndex = i
|
||||
}
|
||||
ScProblemTypeTitle.TITLE_PROBLEM_TYPE -> {
|
||||
MetadataUtils.Companion.ScProblemTypeTitle.TITLE_PROBLEM_TYPE -> {
|
||||
problemTypeIndex = i
|
||||
}
|
||||
ScProblemTypeTitle.TITLE_PHENOMENON -> {
|
||||
MetadataUtils.Companion.ScProblemTypeTitle.TITLE_PHENOMENON -> {
|
||||
phenomenonIndex = i
|
||||
}
|
||||
ScRootCauseAnalysisTitle.TITLE_PROBLEM_LINK -> {
|
||||
MetadataUtils.Companion.ScRootCauseAnalysisTitle.TITLE_PROBLEM_LINK -> {
|
||||
problemLinkIndex = i
|
||||
}
|
||||
ScRootCauseAnalysisTitle.TITLE_PROBLEM_CAUSE -> {
|
||||
MetadataUtils.Companion.ScRootCauseAnalysisTitle.TITLE_PROBLEM_CAUSE -> {
|
||||
problemCauseIndex = i
|
||||
}
|
||||
MetadataUtils.Companion.ScWarningCodeTitle.TITLE_CODE -> {
|
||||
warningCodeIndex = i
|
||||
}
|
||||
MetadataUtils.Companion.ScWarningCodeTitle.TITLE_DESCRIBE -> {
|
||||
warningDescribeIndex = i
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -244,6 +254,12 @@ class PersonalCenterViewModel @Inject constructor(
|
||||
problemCause = data[problemCauseIndex],
|
||||
)
|
||||
list2.add(bean)
|
||||
} else if (warningDescribeIndex > -1 && warningCodeIndex > -1) {
|
||||
val bean = ScWarningCodeBean(
|
||||
code = data[warningCodeIndex],
|
||||
describe = data[warningDescribeIndex]
|
||||
)
|
||||
list3.add(bean)
|
||||
} else {
|
||||
liveDataMessage.postValue("元数据表规格不正确,请仔细核对")
|
||||
break
|
||||
@ -259,49 +275,14 @@ class PersonalCenterViewModel @Inject constructor(
|
||||
liveDataMessage.postValue("元数据表导入成功")
|
||||
roomAppDatabase.getScRootCauseAnalysisDao().insertOrUpdateList(list2)
|
||||
}
|
||||
if(list3.isNotEmpty()){
|
||||
liveDataMessage.postValue("标牌对照表导入成功")
|
||||
roomAppDatabase.getScWarningCodeDao().insertList(list3)
|
||||
}
|
||||
|
||||
bufferedReader.close()
|
||||
inputStreamReader.close()
|
||||
inputStream.close()
|
||||
// val workbook = WorkbookFactory.create(inputStream)
|
||||
// //获取所有sheet
|
||||
// val sheet1 = workbook.getSheet("SC_PROBLEM_TYPE")
|
||||
// sheet1?.let {
|
||||
// val rowCount: Int = it.physicalNumberOfRows // 获取行数
|
||||
// val list = mutableListOf<ScProblemTypeBean>()
|
||||
// for (i in 1 until rowCount) {
|
||||
// val row: Row = it.getRow(i) // 获取行
|
||||
//// val cellCount: Int = row.physicalNumberOfCells // 获取列数
|
||||
// val bean = ScProblemTypeBean(
|
||||
// elementType = row.getCell(0).stringCellValue,
|
||||
// elementCode = row.getCell(1).numericCellValue.toString(),
|
||||
// classType = row.getCell(2).stringCellValue,
|
||||
// problemType = row.getCell(3).stringCellValue,
|
||||
// phenomenon = row.getCell(4).stringCellValue
|
||||
// )
|
||||
// list.add(bean)
|
||||
// Log.e("jingo", bean.toString())
|
||||
// }
|
||||
// roomAppDatabase.getScProblemTypeDao().insertOrUpdateList(list)
|
||||
// }
|
||||
// val sheet2 = workbook.getSheet("SC_ROOT_CAUSE_ANALYSIS")
|
||||
// sheet2?.let {
|
||||
// val rowCount: Int = it.physicalNumberOfRows // 获取行数
|
||||
// val list = mutableListOf<ScRootCauseAnalysisBean>()
|
||||
// for (i in 1 until rowCount) {
|
||||
// val row: Row = it.getRow(i) // 获取行
|
||||
// val cellCount: Int = row.physicalNumberOfCells // 获取列数
|
||||
// if (cellCount == 2) {
|
||||
// val bean = ScRootCauseAnalysisBean()
|
||||
// bean.problemLink = row.getCell(0).stringCellValue
|
||||
// bean.problemCause = row.getCell(1).stringCellValue
|
||||
// list.add(bean)
|
||||
// Log.e("jingo", bean.toString())
|
||||
// }
|
||||
// }
|
||||
// roomAppDatabase.getScRootCauseAnalysisDao().insertOrUpdateList(list)
|
||||
// }
|
||||
// workbook.close()
|
||||
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
|
@ -5,6 +5,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity
|
||||
@ -56,29 +57,29 @@ class SignMoreInfoFragment : BaseFragment() {
|
||||
drawableLeft, null, drawableRight, null
|
||||
)
|
||||
|
||||
when (it.code) {
|
||||
when (it.renderEntity.code) {
|
||||
//道路名
|
||||
DataCodeEnum.OMDB_LINK_NAME.code -> {
|
||||
val adapter = RoadNameInfoAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getRoadNameList(it))
|
||||
adapter.refreshData(SignUtil.getRoadNameList(it.renderEntity))
|
||||
}
|
||||
//车道边界类型
|
||||
DataCodeEnum.OMDB_LANE_MARK_BOUNDARYTYPE.code -> {
|
||||
val adapter = LaneBoundaryAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getLaneBoundaryTypeInfo(it))
|
||||
adapter.refreshData(SignUtil.getLaneBoundaryTypeInfo(it.renderEntity))
|
||||
}
|
||||
DataCodeEnum.OMDB_INTERSECTION.code -> {
|
||||
val adapter = LaneBoundaryAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getIntersectionInfo(it))
|
||||
adapter.refreshData(SignUtil.getIntersectionInfo(it.renderEntity))
|
||||
}
|
||||
//收费站
|
||||
DataCodeEnum.OMDB_TOLLGATE.code -> {
|
||||
val adapter = LaneBoundaryAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getTollgateInfo(it))
|
||||
adapter.refreshData(SignUtil.getTollgateInfo(it.renderEntity))
|
||||
}
|
||||
//电子眼
|
||||
DataCodeEnum.OMDB_ELECTRONICEYE.code -> {
|
||||
@ -94,10 +95,16 @@ class SignMoreInfoFragment : BaseFragment() {
|
||||
)
|
||||
val adapter = TwoItemAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getElectronicEyeMoreInfo(it))
|
||||
adapter.refreshData(SignUtil.getElectronicEyeMoreInfo(it.renderEntity))
|
||||
}
|
||||
//交通标牌
|
||||
DataCodeEnum.OMDB_TRAFFIC_SIGN.code -> {
|
||||
val adapter = TwoItemAdapter()
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
adapter.refreshData(SignUtil.getTrafficSignMoreInfo(it.renderEntity))
|
||||
}
|
||||
else -> {
|
||||
val adapter = SignUtil.getMoreInfoAdapter(it)
|
||||
val adapter = SignUtil.getMoreInfoAdapter(it.renderEntity)
|
||||
binding.signInfoRecyclerview.adapter = adapter
|
||||
}
|
||||
}
|
||||
@ -117,18 +124,7 @@ class SignMoreInfoFragment : BaseFragment() {
|
||||
val bundle = Bundle()
|
||||
val element = viewModel.liveDataSignMoreInfo.value
|
||||
if (element != null) {
|
||||
val signBean = SignBean(
|
||||
iconId = SignUtil.getSignIcon(element),
|
||||
iconText = SignUtil.getSignIconText(element),
|
||||
linkId = element.properties[RenderEntity.Companion.LinkTable.linkPid]
|
||||
?: "",
|
||||
name = SignUtil.getSignNameText(element),
|
||||
bottomRightText = SignUtil.getSignBottomRightText(element),
|
||||
renderEntity = element,
|
||||
isMoreInfo = SignUtil.isMoreInfo(element),
|
||||
index = SignUtil.getRoadInfoIndex(element)
|
||||
)
|
||||
bundle.putParcelable("SignBean", signBean)
|
||||
bundle.putParcelable("SignBean", element)
|
||||
bundle.putBoolean("AutoSave", false)
|
||||
rightController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.navinfo.omqs.ui.fragment.tasklist
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Color
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@ -225,6 +226,9 @@ class TaskListAdapter(
|
||||
binding.taskUploadBtn.stopAnimator()
|
||||
binding.taskUploadBtn.setText("重新同步")
|
||||
binding.taskUploadBtn.setProgress(100)
|
||||
if(!TextUtils.isEmpty(taskBean.errMsg)){
|
||||
Toast.makeText(binding.root.context,taskBean.errMsg,Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
FileUploadStatus.NONE -> {
|
||||
|
@ -487,35 +487,59 @@ 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
|
||||
}
|
||||
}
|
||||
realm.close()
|
||||
if(result==1){
|
||||
liveDataTaskUpload.postValue(map)
|
||||
withContext(Dispatchers.Main) {
|
||||
val mDialog = FirstDialog(context)
|
||||
mDialog.setTitle("提示?")
|
||||
mDialog.setMessage("此任务中存在新增Link无问题记录,请添加至少一条记录!")
|
||||
mDialog.setPositiveButton(
|
||||
"确定"
|
||||
) { _, _ ->
|
||||
mDialog.dismiss()
|
||||
}
|
||||
mDialog.setCancelVisibility(View.GONE)
|
||||
mDialog.show()
|
||||
}
|
||||
}else if(result==2){
|
||||
liveDataTaskUpload.postValue(map)
|
||||
withContext(Dispatchers.Main) {
|
||||
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)
|
||||
}
|
||||
realm.close()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,70 @@
|
||||
package com.navinfo.omqs.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import com.navinfo.omqs.R
|
||||
|
||||
class AddAndSubEditView @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr), View.OnClickListener {
|
||||
|
||||
private var valueText: Int = 0
|
||||
private val editView: EditText
|
||||
|
||||
init {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
val view = inflater.inflate(R.layout.view_add_del_editview, this)
|
||||
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.AddAndSubEditView)
|
||||
valueText = typedArray.getInteger(R.styleable.AddAndSubEditView_textValue, 0)
|
||||
editView = view.findViewById(R.id.edit_text)
|
||||
editView.setText("$valueText")
|
||||
editView.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable) {
|
||||
try {
|
||||
valueText = s.toString().toInt()
|
||||
} catch (e: java.lang.Exception) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
view.findViewById<ImageView>(R.id.del).setOnClickListener(this)
|
||||
view.findViewById<ImageView>(R.id.add).setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.del -> {
|
||||
valueText--
|
||||
editView.setText("$valueText")
|
||||
}
|
||||
R.id.add -> {
|
||||
valueText++
|
||||
editView.setText("$valueText")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getValue(): Int {
|
||||
return valueText
|
||||
}
|
||||
|
||||
fun setValue(value:Int) {
|
||||
valueText = value
|
||||
editView.setText("$valueText")
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@ import org.locationtech.jts.geom.LineString
|
||||
import org.locationtech.jts.geom.Point
|
||||
import org.oscim.core.GeoPoint
|
||||
|
||||
public interface OnNaviEngineCallbackListener {
|
||||
interface OnNaviEngineCallbackListener {
|
||||
fun planningPathStatus(code: NaviStatus)
|
||||
|
||||
// fun planningPathError(errorCode: NaviStatus, errorMessage: String)
|
||||
@ -33,10 +33,33 @@ enum class NaviStatus {
|
||||
}
|
||||
|
||||
|
||||
data class NaviOption(
|
||||
/**
|
||||
* 偏离距离 单位:米
|
||||
*/
|
||||
var deviationDistance: Int = 15,
|
||||
|
||||
/**
|
||||
* 偏离次数上限
|
||||
*/
|
||||
var deviationCount: Int = 5,
|
||||
|
||||
// /**
|
||||
// * 局部匹配时,没走过的路段还记录1000米
|
||||
// */
|
||||
// var nextRouteDistance: Int = 1000,
|
||||
|
||||
/**
|
||||
* 最远显示距离 米
|
||||
*/
|
||||
var farthestDisplayDistance: Int = 550,
|
||||
)
|
||||
|
||||
class NaviEngine(
|
||||
private val niMapController: NIMapController,
|
||||
private val realmOperateHelper: RealmOperateHelper,
|
||||
val callback: OnNaviEngineCallbackListener
|
||||
val callback: OnNaviEngineCallbackListener,
|
||||
var naviOption: NaviOption = NaviOption()
|
||||
) {
|
||||
|
||||
/**
|
||||
@ -64,30 +87,30 @@ class NaviEngine(
|
||||
DataCodeEnum.OMDB_LINK_NAME.name,
|
||||
)
|
||||
|
||||
/**
|
||||
* 偏离距离 单位:米
|
||||
*/
|
||||
private val DEVIATION_DISTANCE = 15
|
||||
|
||||
/**
|
||||
* 偏离次数上限
|
||||
*/
|
||||
private val DEVIATION_COUNT = 5
|
||||
|
||||
// /**
|
||||
// * 偏离距离 单位:米
|
||||
// */
|
||||
// private val DEVIATION_DISTANCE = 15
|
||||
//
|
||||
// /**
|
||||
// * 偏离次数上限
|
||||
// */
|
||||
// private val DEVIATION_COUNT = 5
|
||||
//
|
||||
/**
|
||||
* 局部匹配时,走过的路段还记录100米
|
||||
*/
|
||||
private val PASSED_ROUTE_DISTANCE = 100
|
||||
|
||||
/**
|
||||
* 局部匹配时,没走过的路段还记录1000米
|
||||
*/
|
||||
private val NEXT_ROUTE_DISTANCE = 1000
|
||||
|
||||
/**
|
||||
* 最远显示距离 米
|
||||
*/
|
||||
private val FARTHEST_DISPLAY_DISTANCE = 550
|
||||
//
|
||||
// /**
|
||||
// * 局部匹配时,没走过的路段还记录1000米
|
||||
// */
|
||||
// private val NEXT_ROUTE_DISTANCE = 1000
|
||||
//
|
||||
// /**
|
||||
// * 最远显示距离 米
|
||||
// */
|
||||
// private val FARTHEST_DISPLAY_DISTANCE = 550
|
||||
|
||||
/**
|
||||
* 绑定失败次数
|
||||
@ -144,32 +167,34 @@ class NaviEngine(
|
||||
}
|
||||
set(value) {
|
||||
val list = mutableListOf<GeoPoint>()
|
||||
val fRoute = value[0]
|
||||
//第一个路段加入
|
||||
list.addAll(fRoute.pointList)
|
||||
//起始点位置
|
||||
fRoute.startIndexInPath = 0
|
||||
var startPoint = fRoute.pointList.size - 1
|
||||
//终点位置
|
||||
fRoute.endIndexIntPath = startPoint
|
||||
fRoute.indexInPath = 0
|
||||
if (value.size > 0) {
|
||||
val fRoute = value[0]
|
||||
//第一个路段加入
|
||||
list.addAll(fRoute.pointList)
|
||||
//起始点位置
|
||||
fRoute.startIndexInPath = 0
|
||||
var startPoint = fRoute.pointList.size - 1
|
||||
//终点位置
|
||||
fRoute.endIndexIntPath = startPoint
|
||||
fRoute.indexInPath = 0
|
||||
|
||||
for (i in 1 until value.size) {
|
||||
val route = value[i]
|
||||
route.startIndexInPath = startPoint
|
||||
if (route.itemList != null) {
|
||||
for (naviItem in route.itemList!!) {
|
||||
naviItem.index += startPoint
|
||||
for (i in 1 until value.size) {
|
||||
val route = value[i]
|
||||
route.startIndexInPath = startPoint
|
||||
if (route.itemList != null) {
|
||||
for (naviItem in route.itemList!!) {
|
||||
naviItem.index += startPoint
|
||||
}
|
||||
}
|
||||
startPoint += route.pointList.size - 1
|
||||
route.endIndexIntPath = startPoint
|
||||
route.indexInPath = i
|
||||
val list2 = ArrayList(route.pointList.toList())
|
||||
list2.removeAt(0)
|
||||
list.addAll(list2)
|
||||
}
|
||||
startPoint += route.pointList.size - 1
|
||||
route.endIndexIntPath = startPoint
|
||||
route.indexInPath = i
|
||||
val list2 = ArrayList(route.pointList.toList())
|
||||
list2.removeAt(0)
|
||||
list.addAll(list2)
|
||||
geometry = GeometryTools.createLineString(list)
|
||||
}
|
||||
geometry = GeometryTools.createLineString(list)
|
||||
field = value
|
||||
}
|
||||
|
||||
@ -257,73 +282,78 @@ class NaviEngine(
|
||||
break
|
||||
}
|
||||
}
|
||||
if (routeStart != null) {
|
||||
var sNode = ""
|
||||
var eNode = ""
|
||||
//如果sNode,eNode是顺方向,geometry 不动,否则反转
|
||||
if (routeStart.direct == 3) {
|
||||
routeStart.pointList.reverse()
|
||||
sNode = routeStart.eNode
|
||||
eNode = routeStart.sNode
|
||||
} else {
|
||||
sNode = routeStart.sNode
|
||||
eNode = routeStart.eNode
|
||||
|
||||
if (routeStart == null) {
|
||||
routeStart = tempRouteList[0]
|
||||
tempRouteList.removeAt(0)
|
||||
}
|
||||
|
||||
var sNode = ""
|
||||
var eNode = ""
|
||||
//如果sNode,eNode是顺方向,geometry 不动,否则反转
|
||||
if (routeStart.direct == 3) {
|
||||
routeStart.pointList.reverse()
|
||||
sNode = routeStart.eNode
|
||||
eNode = routeStart.sNode
|
||||
} else {
|
||||
sNode = routeStart.sNode
|
||||
eNode = routeStart.eNode
|
||||
}
|
||||
newRouteList.add(routeStart)
|
||||
var bBreak = true
|
||||
while (bBreak) {
|
||||
//先找其实link的后续link
|
||||
var bHasNext = false
|
||||
for (route in tempRouteList) {
|
||||
//如果是link 的e 对下个link的s,方向不用动,否则下个link的geometry反转
|
||||
if (route.sNode != "" && eNode == route.sNode) {
|
||||
newRouteList.add(route)
|
||||
tempRouteList.remove(route)
|
||||
eNode = route.eNode
|
||||
bHasNext = true
|
||||
break
|
||||
} else if (route.eNode != "" && eNode == route.eNode) {
|
||||
route.pointList.reverse()
|
||||
newRouteList.add(route)
|
||||
tempRouteList.remove(route)
|
||||
eNode = route.sNode
|
||||
bHasNext = true
|
||||
break
|
||||
}
|
||||
}
|
||||
newRouteList.add(routeStart)
|
||||
var bBreak = true
|
||||
while (bBreak) {
|
||||
//先找其实link的后续link
|
||||
var bHasNext = false
|
||||
for (route in tempRouteList) {
|
||||
//如果是link 的e 对下个link的s,方向不用动,否则下个link的geometry反转
|
||||
if (route.sNode != "" && eNode == route.sNode) {
|
||||
newRouteList.add(route)
|
||||
tempRouteList.remove(route)
|
||||
eNode = route.eNode
|
||||
bHasNext = true
|
||||
break
|
||||
} else if (route.eNode != "" && eNode == route.eNode) {
|
||||
route.pointList.reverse()
|
||||
newRouteList.add(route)
|
||||
tempRouteList.remove(route)
|
||||
eNode = route.sNode
|
||||
bHasNext = true
|
||||
break
|
||||
}
|
||||
//先找其实link的起始link
|
||||
var bHasLast = false
|
||||
for (route in tempRouteList) {
|
||||
//如果是link 的s 对上个link的e,方向不用动,否则下个link的geometry反转
|
||||
if (route.eNode != "" && sNode == route.eNode) {
|
||||
newRouteList.add(0, route)
|
||||
tempRouteList.remove(route)
|
||||
sNode = route.sNode
|
||||
bHasLast = true
|
||||
break
|
||||
} else if (route.sNode != "" && sNode == route.sNode) {
|
||||
route.pointList.reverse()
|
||||
newRouteList.add(0, route)
|
||||
tempRouteList.remove(route)
|
||||
sNode = route.eNode
|
||||
bHasLast = true
|
||||
break
|
||||
}
|
||||
//先找其实link的起始link
|
||||
var bHasLast = false
|
||||
for (route in tempRouteList) {
|
||||
//如果是link 的s 对上个link的e,方向不用动,否则下个link的geometry反转
|
||||
if (route.eNode != "" && sNode == route.eNode) {
|
||||
newRouteList.add(0, route)
|
||||
tempRouteList.remove(route)
|
||||
sNode = route.sNode
|
||||
bHasLast = true
|
||||
break
|
||||
} else if (route.sNode != "" && sNode == route.sNode) {
|
||||
route.pointList.reverse()
|
||||
newRouteList.add(0, route)
|
||||
tempRouteList.remove(route)
|
||||
sNode = route.eNode
|
||||
bHasLast = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (tempRouteList.size == 0) {
|
||||
}
|
||||
if (tempRouteList.size == 0) {
|
||||
bBreak = false
|
||||
} else {
|
||||
if (!bHasLast && !bHasNext) {
|
||||
bBreak = false
|
||||
} else {
|
||||
if (!bHasLast && !bHasNext) {
|
||||
bBreak = false
|
||||
callback.planningPathStatus(
|
||||
NaviStatus.NAVI_STATUS_PATH_ERROR_BLOCKED
|
||||
)
|
||||
realm.close()
|
||||
return
|
||||
}
|
||||
callback.planningPathStatus(
|
||||
NaviStatus.NAVI_STATUS_PATH_ERROR_BLOCKED
|
||||
)
|
||||
realm.close()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val itemMap: MutableMap<GeoPoint, MutableList<RenderEntity>> = mutableMapOf()
|
||||
//查询每根link上的关联要素
|
||||
for (route in newRouteList) {
|
||||
@ -415,7 +445,7 @@ class NaviEngine(
|
||||
val pointPairDistance = GeometryTools.pointToLineDistance(point, geometry)
|
||||
//定义垂线
|
||||
//定位点到垂足距离不超过30米
|
||||
if (pointPairDistance.getMeterDistance() < DEVIATION_DISTANCE) {
|
||||
if (pointPairDistance.getMeterDistance() < naviOption.deviationDistance) {
|
||||
footIndex = pointPairDistance.footIndex
|
||||
// Log.e(
|
||||
// "jingo",
|
||||
@ -453,7 +483,7 @@ class NaviEngine(
|
||||
val pointPairDistance = GeometryTools.pointToLineDistance(point, tempGeometry)
|
||||
//定义垂线
|
||||
//定位点到垂足距离不超过30米
|
||||
if (pointPairDistance.getMeterDistance() < DEVIATION_DISTANCE) {
|
||||
if (pointPairDistance.getMeterDistance() < naviOption.deviationDistance) {
|
||||
footIndex = pointPairDistance.footIndex + tempRoutList[0].startIndexInPath
|
||||
// Log.e("jingo", "局部 当前绑定到了整条路线的第 $footIndex 点")
|
||||
val lastRouteIndex = routeIndex
|
||||
@ -531,7 +561,7 @@ class NaviEngine(
|
||||
tempIndex = rightI + 1
|
||||
distance = GeometryTools.getDistance(disPoints)
|
||||
// Log.e("jingo", "我的距离${distance} 下一个${tempIndex} 位置${rightI}")
|
||||
if (distance < FARTHEST_DISPLAY_DISTANCE && distance > -1) {
|
||||
if (distance < naviOption.farthestDisplayDistance && distance > -1) {
|
||||
naviItem.distance = distance.toInt()
|
||||
bindingItemList.add(naviItem)
|
||||
} else {
|
||||
@ -539,7 +569,7 @@ class NaviEngine(
|
||||
}
|
||||
}
|
||||
}
|
||||
if (distance >= FARTHEST_DISPLAY_DISTANCE) {
|
||||
if (distance >= naviOption.farthestDisplayDistance) {
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -570,7 +600,8 @@ class NaviEngine(
|
||||
distance = 0.0
|
||||
//没走过的路是否有1000米
|
||||
var j = routeIndex + 1
|
||||
while (j < routeList.size && distance < NEXT_ROUTE_DISTANCE) {
|
||||
val nextDis = naviOption.farthestDisplayDistance + 500
|
||||
while (j < routeList.size && distance < nextDis) {
|
||||
val routeT = routeList[j]
|
||||
tempRoutList.add(routeT)
|
||||
distance += routeT.length
|
||||
@ -596,7 +627,7 @@ class NaviEngine(
|
||||
*/
|
||||
private fun deviationUp() {
|
||||
errorCount++
|
||||
if (errorCount >= DEVIATION_COUNT) {
|
||||
if (errorCount >= naviOption.deviationCount) {
|
||||
callback.planningPathStatus(NaviStatus.NAVI_STATUS_DISTANCE_OFF)
|
||||
bindingReset()
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.navinfo.omqs.util
|
||||
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity
|
||||
import com.navinfo.collect.library.enums.DataCodeEnum
|
||||
import com.navinfo.collect.library.utils.FootAndDistance
|
||||
@ -8,10 +9,15 @@ import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.bean.RoadNameBean
|
||||
import com.navinfo.omqs.bean.SignBean
|
||||
import com.navinfo.omqs.db.RoomAppDatabase
|
||||
import com.navinfo.omqs.ui.activity.map.LaneInfoItem
|
||||
import com.navinfo.omqs.ui.fragment.signMoreInfo.LaneBoundaryItem
|
||||
import com.navinfo.omqs.ui.fragment.signMoreInfo.TwoItemAdapter
|
||||
import com.navinfo.omqs.ui.fragment.signMoreInfo.TwoItemAdapterItem
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import org.locationtech.jts.geom.Geometry
|
||||
@ -23,6 +29,28 @@ import java.lang.reflect.Field
|
||||
class SignUtil {
|
||||
companion object {
|
||||
|
||||
suspend fun createSignBean(
|
||||
scope: CoroutineScope,
|
||||
roomAppDatabase: RoomAppDatabase,
|
||||
element: RenderEntity
|
||||
): SignBean {
|
||||
return SignBean(
|
||||
iconId = getSignIcon(element),
|
||||
iconText = getSignIconText(element),
|
||||
linkId = element.properties[RenderEntity.Companion.LinkTable.linkPid]
|
||||
?: "",
|
||||
name = getSignNameText(element),
|
||||
bottomRightText = getSignBottomRightText(
|
||||
scope,
|
||||
roomAppDatabase,
|
||||
element
|
||||
),
|
||||
renderEntity = element,
|
||||
isMoreInfo = isMoreInfo(element),
|
||||
index = getRoadInfoIndex(element)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取面板上的文字
|
||||
*/
|
||||
@ -50,6 +78,10 @@ class SignUtil {
|
||||
DataCodeEnum.OMDB_LINK_SPEEDLIMIT.code -> {
|
||||
"${data.properties["maxSpeed"]}"
|
||||
}
|
||||
//条件线限速
|
||||
DataCodeEnum.OMDB_LINK_SPEEDLIMIT_COND.code -> {
|
||||
"${data.properties["maxSpeed"]}"
|
||||
}
|
||||
//全封闭
|
||||
DataCodeEnum.OMDB_CON_ACCESS.code -> {
|
||||
if (data.properties["conAccess"] === "1") "全封闭" else ""
|
||||
@ -130,6 +162,8 @@ class SignUtil {
|
||||
DataCodeEnum.OMDB_LINK_DIRECT.code -> "方向"
|
||||
//常规线限速
|
||||
DataCodeEnum.OMDB_LINK_SPEEDLIMIT.code -> "线限速"
|
||||
//条件线限速
|
||||
DataCodeEnum.OMDB_LINK_SPEEDLIMIT_COND.code -> "条件限速"
|
||||
|
||||
DataCodeEnum.OMDB_LINK_ATTRIBUTE_MAIN_SIDE_ACCESS.code, DataCodeEnum.OMDB_LINK_ATTRIBUTE_FORNTAGE.code, DataCodeEnum.OMDB_LINK_ATTRIBUTE_SA.code, DataCodeEnum.OMDB_LINK_ATTRIBUTE_PA.code -> "道路属性"
|
||||
|
||||
@ -197,7 +231,6 @@ class SignUtil {
|
||||
} catch (e: Throwable) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//道路方向
|
||||
DataCodeEnum.OMDB_LINK_DIRECT.code -> {
|
||||
@ -793,9 +826,25 @@ class SignUtil {
|
||||
/**
|
||||
* 右下角文字
|
||||
*/
|
||||
fun getSignBottomRightText(data: RenderEntity): String {
|
||||
suspend fun getSignBottomRightText(
|
||||
scope: CoroutineScope,
|
||||
roomAppDatabase: RoomAppDatabase,
|
||||
data: RenderEntity
|
||||
): String {
|
||||
return when (data.code) {
|
||||
|
||||
//警示信息
|
||||
DataCodeEnum.OMDB_WARNINGSIGN.code -> {
|
||||
var describe = ""
|
||||
val job = scope.launch(Dispatchers.IO) {
|
||||
val typeCode = data.properties["typeCode"]
|
||||
if (typeCode != null) {
|
||||
describe = roomAppDatabase.getScWarningCodeDao().findScWarningDescribe(typeCode).toString()
|
||||
}
|
||||
}
|
||||
job.join()
|
||||
Log.e("jingo", "警示信息 类型: $describe")
|
||||
return describe
|
||||
}
|
||||
//条件点限速
|
||||
DataCodeEnum.OMDB_SPEEDLIMIT_COND.code -> getConditionLimitText(data)
|
||||
//电子眼
|
||||
@ -870,13 +919,11 @@ class SignUtil {
|
||||
)
|
||||
)
|
||||
val carType = renderEntity.properties["vehicleType"]
|
||||
if (carType != "0") {
|
||||
list.add(
|
||||
TwoItemAdapterItem(
|
||||
title = "车辆类型", text = getElectronicEyeVehicleType(carType!!.toInt())
|
||||
)
|
||||
list.add(
|
||||
TwoItemAdapterItem(
|
||||
title = "车辆类型", text = getElectronicEyeVehicleType(carType!!.toInt())
|
||||
)
|
||||
}
|
||||
)
|
||||
val time = renderEntity.properties["validPeriod"]
|
||||
if (time?.isNotEmpty() == true) {
|
||||
list.add(
|
||||
@ -893,7 +940,7 @@ class SignUtil {
|
||||
* 条件点限速文字
|
||||
*/
|
||||
private fun getConditionLimitText(data: RenderEntity): String {
|
||||
var stringBuffer = StringBuffer()
|
||||
val stringBuffer = StringBuffer()
|
||||
try {
|
||||
val dependent = data.properties["speedDependent"]
|
||||
dependent?.let {
|
||||
@ -1515,7 +1562,8 @@ class SignUtil {
|
||||
DataCodeEnum.OMDB_RD_LINK_KIND.code -> 1
|
||||
DataCodeEnum.OMDB_RD_LINK_FUNCTION_CLASS.code -> 2
|
||||
DataCodeEnum.OMDB_LINK_SPEEDLIMIT.code -> 3
|
||||
DataCodeEnum.OMDB_LINK_DIRECT.code -> 4
|
||||
DataCodeEnum.OMDB_LINK_SPEEDLIMIT_COND.code -> 4
|
||||
DataCodeEnum.OMDB_LINK_DIRECT.code -> 5
|
||||
else -> 999
|
||||
}
|
||||
}
|
||||
@ -1602,6 +1650,55 @@ class SignUtil {
|
||||
return list
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取交通标牌详细信息
|
||||
*/
|
||||
fun getTrafficSignMoreInfo(renderEntity: RenderEntity): List<TwoItemAdapterItem> {
|
||||
val list = mutableListOf<TwoItemAdapterItem>()
|
||||
val trafsignShape = when (renderEntity.properties["trafsignShape"]) {
|
||||
"1" -> "不规则形状"
|
||||
"2" -> "长方形"
|
||||
"3" -> "三角形"
|
||||
"4" -> "圆形"
|
||||
"5" -> "菱形"
|
||||
"6" -> "到三角形"
|
||||
"7" -> "正方形"
|
||||
"8" -> "八角形"
|
||||
else -> ""
|
||||
}
|
||||
if (trafsignShape != "") {
|
||||
list.add(
|
||||
TwoItemAdapterItem(
|
||||
title = "形状", text = trafsignShape
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
val color = when (renderEntity.properties["color"]) {
|
||||
"0" -> "未验证"
|
||||
"1" -> "白色"
|
||||
"2" -> "黄色"
|
||||
"3" -> "红色"
|
||||
"5" -> "棕色"
|
||||
"6" -> "蓝色"
|
||||
"7" -> "绿色"
|
||||
"8" -> "黑色"
|
||||
"9" -> "其他"
|
||||
else -> ""
|
||||
}
|
||||
list.add(
|
||||
TwoItemAdapterItem(
|
||||
title = "颜色", text = color
|
||||
)
|
||||
)
|
||||
list.add(
|
||||
TwoItemAdapterItem(
|
||||
title = "正北夹角", text = "${renderEntity.properties["heading"]}"
|
||||
)
|
||||
)
|
||||
return list
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算捕捉点到
|
||||
*/
|
||||
@ -1631,8 +1728,8 @@ class SignUtil {
|
||||
} else if (itemGeometry is LineString) {
|
||||
val itemFoot = GeometryTools.pointToLineDistance(
|
||||
GeoPoint(
|
||||
lineString.coordinates[lineString.coordinates.size-1].y,
|
||||
lineString.coordinates[lineString.coordinates.size-1].x
|
||||
lineString.coordinates[lineString.coordinates.size - 1].y,
|
||||
lineString.coordinates[lineString.coordinates.size - 1].x
|
||||
), lineString
|
||||
)
|
||||
var dis = GeometryTools.getDistance(
|
||||
@ -1649,7 +1746,5 @@ class SignUtil {
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
BIN
app/src/main/res/drawable-xxhdpi/icon_close_catch_line.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/drawable-xxhdpi/icon_open_catch_line.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
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"
|
||||
|
124
app/src/main/res/layout/fragment_navi_setting.xml
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
style="@style/left_pannel_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/bg_left_pannel"
|
||||
android:padding="5dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_back"
|
||||
style="@style/btn_round"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/selector_bg_round_button"
|
||||
android:foreground="@drawable/ripple_btn_press"
|
||||
android:src="@drawable/ic_baseline_keyboard_arrow_left_24"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/img_confirm"
|
||||
style="@style/btn_round"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/selector_bg_round_button"
|
||||
android:foreground="@drawable/ripple_btn_press"
|
||||
android:src="@drawable/ic_baseline_check_24"
|
||||
app:layout_constraintBottom_toBottomOf="@id/img_back"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/img_back" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="导航设置"
|
||||
android:textColor="@color/highFontColor"
|
||||
android:textSize="@dimen/left_pannel_title_font"
|
||||
app:layout_constraintBottom_toBottomOf="@id/img_back"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/img_back" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
style="@style/default_card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/img_back">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left|center_vertical"
|
||||
android:textSize="16sp"
|
||||
android:text="偏离距离(米)" />
|
||||
|
||||
<com.navinfo.omqs.ui.widget.AddAndSubEditView
|
||||
android:id="@+id/off_distance"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right|center_vertical"
|
||||
app:textValue="15" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left|center_vertical"
|
||||
android:textSize="16sp"
|
||||
android:text="提示范围(米)" />
|
||||
|
||||
<com.navinfo.omqs.ui.widget.AddAndSubEditView
|
||||
android:id="@+id/tips_distance"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right|center_vertical"
|
||||
app:textValue="500" />
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left|center_vertical"
|
||||
android:textSize="16sp"
|
||||
android:text="偏离次数" />
|
||||
|
||||
<com.navinfo.omqs.ui.widget.AddAndSubEditView
|
||||
android:id="@+id/off_count"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right|center_vertical"
|
||||
app:textValue="3" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
34
app/src/main/res/layout/view_add_del_editview.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/del"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_bg_blue_bg_4_radius"
|
||||
android:src="@drawable/ic_baseline_keyboard_arrow_left_24" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:focusable="false"
|
||||
android:gravity="center"
|
||||
android:inputType="number"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="3dp"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/add"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_bg_blue_bg_4_radius"
|
||||
android:src="@drawable/ic_baseline_keyboard_arrow_right_24" />
|
||||
</LinearLayout>
|
@ -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"
|
||||
@ -54,7 +59,7 @@
|
||||
<item
|
||||
android:id="@+id/personal_center_menu_version"
|
||||
android:icon="@drawable/ic_baseline_layers_24"
|
||||
android:title="版本:23QE4_V1.5.2_20230919_A" />
|
||||
android:title="版本:23QE4_V1.5.4_20230926_A" />
|
||||
</group>
|
||||
<group android:checkableBehavior="single">
|
||||
<item android:title="小标题">
|
||||
|
@ -44,4 +44,12 @@
|
||||
tools:layout="@layout/fragment_qs_record_list">
|
||||
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/QsNaviSettingFragment"
|
||||
android:name="com.navinfo.omqs.ui.fragment.navi.NaviSettingFragment"
|
||||
android:label="导航设置"
|
||||
tools:layout="@layout/fragment_navi_setting">
|
||||
|
||||
</fragment>
|
||||
</navigation>
|
@ -15,4 +15,13 @@
|
||||
<attr name="deleteBtnWidth" format="float"/>
|
||||
</declare-styleable>
|
||||
|
||||
|
||||
<declare-styleable name="CanvasView">
|
||||
<attr name="isSavePoint" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="AddAndSubEditView">
|
||||
<attr name="textValue" format="integer" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<declare-styleable name="CanvasView">
|
||||
<attr name="isSavePoint" format="boolean" />
|
||||
</declare-styleable>
|
||||
</resources>
|
@ -1587,12 +1587,12 @@
|
||||
|
||||
<!--车道中心线-->
|
||||
<m v="OMDB_LANE_LINK_LG">
|
||||
<m k="width" v="~">
|
||||
<line stroke="#7A88A0" width="2.8" />
|
||||
<!--
|
||||
<line stroke="#7A88A0" width="2.5" />
|
||||
-->
|
||||
<m k="widthProperties">
|
||||
<area use="obj-area" stroke="#7A88A0" repeat="true" src="assets:omdb/icon_5001_0.png" longEdge="t"></area>
|
||||
</m>
|
||||
<!-- <m k="width" v="~">
|
||||
<line stroke="#4624FF" width="0.1" />
|
||||
</m>-->
|
||||
</m>
|
||||
|
||||
<!-- 检查点 -->
|
||||
@ -1630,7 +1630,7 @@
|
||||
</m>-->
|
||||
<m k="boundaryType" v="1">
|
||||
<!--无标线无可区分边界-->
|
||||
<line dasharray="5,5" repeat-start="0" stroke="#ffffff" width="0.2"/>
|
||||
<line dasharray="2,2" repeat-start="0" stroke="#ffffff" width="0.2"/>
|
||||
</m>
|
||||
</m>
|
||||
|
||||
@ -1639,15 +1639,19 @@
|
||||
|
||||
<outline-layer id="boundary" stroke="#ffffff" width="0.1" />
|
||||
|
||||
<!--只区分虚线与实线-->
|
||||
<!-- <m k="boundaryType" v="1">
|
||||
<line dasharray="5,5" repeat-start="5" stroke="#90A0BD" width="0.05"/>
|
||||
</m>-->
|
||||
<!--护栏-->
|
||||
<m k="boundaryType" v="4">
|
||||
<line stroke="#FFBC6E" use="boundaryType" width="0.1"/>
|
||||
<symbol repeat-gap="12" repeat="true" repeat-start="0" src="assets:omdb/icon_2013_4.svg" symbol-width="16" symbol-height="46"></symbol>
|
||||
</m>
|
||||
<!--路牙-->
|
||||
<m k="boundaryType" v="3">
|
||||
<symbol repeat="true" repeat-gap="10" repeat-start="0" src="assets:omdb/icon_2013_3.svg" symbol-width="16" symbol-height="10"></symbol>
|
||||
</m>
|
||||
|
||||
<m k="boundaryType" v="2">
|
||||
<!--标线-->
|
||||
<m k="markType" v="0|1|4|5|6|7|8">
|
||||
<!--其他|实线-->
|
||||
<m k="markType" v="1">
|
||||
<m k="markColor" v="1">
|
||||
<line stroke="#ffffff" use="boundaryType" />
|
||||
</m>
|
||||
@ -1667,11 +1671,7 @@
|
||||
<line stroke="#8e44ad" use="boundaryType" />
|
||||
</m>
|
||||
</m>
|
||||
<m k="markType" v="2|3">
|
||||
<!--其他|实线-->
|
||||
<m v="0|1|2|3|4|5|6|7|8">
|
||||
|
||||
<!--其他|实线-->
|
||||
<m k="markType" v="2">
|
||||
<m k="markColor" v="1">
|
||||
<line dasharray="2,2" repeat-start="0" stroke="#ffffff" width="0.1"/>
|
||||
</m>
|
||||
@ -1690,19 +1690,50 @@
|
||||
<m k="markColor" v="0|9">
|
||||
<line dasharray="2,2" repeat-start="0" stroke="#8e44ad" width="0.1"/>
|
||||
</m>
|
||||
</m>
|
||||
<m k="markType" v="8">
|
||||
<m k="markColor" v="1">
|
||||
<line dasharray="1,1" repeat-start="0" stroke="#ffffff" width="0.1"/>
|
||||
</m>
|
||||
<m k="markColor" v="2">
|
||||
<line dasharray="1,1" repeat-start="0" stroke="#eccc68" width="0.1"/>
|
||||
</m>
|
||||
|
||||
<m k="markColor" v="6">
|
||||
<line dasharray="1,1" repeat-start="0" stroke="#0000ff" width="0.1"/>
|
||||
</m>
|
||||
|
||||
<m k="markColor" v="7">
|
||||
<line dasharray="1,1" repeat-start="0" stroke="#00ff00" width="0.1"/>
|
||||
</m>
|
||||
|
||||
<m k="markColor" v="0|9">
|
||||
<line dasharray="1,1" repeat-start="0" stroke="#8e44ad" width="0.1"/>
|
||||
</m>
|
||||
</m>
|
||||
<m k="markType" v="6">
|
||||
<!--其他|实线-->
|
||||
<m k="markColor" v="1">
|
||||
<symbol repeat="true" repeat-start="0" repeat-gap="24" src="assets:omdb/icon_2013_1.svg"/>
|
||||
</m>
|
||||
<m k="markColor" v="2">
|
||||
<symbol repeat="true" repeat-start="0" repeat-gap="24" src="assets:omdb/icon_2013_2.svg"></symbol>
|
||||
</m>
|
||||
|
||||
<m k="markColor" v="6">
|
||||
<symbol repeat="true" repeat-start="0" repeat-gap="24" src="assets:omdb/icon_2013_6.svg"></symbol>
|
||||
</m>
|
||||
|
||||
<m k="markColor" v="7">
|
||||
<symbol repeat="true" repeat-start="0" repeat-gap="24" src="assets:omdb/icon_2013_7.svg"></symbol>
|
||||
</m>
|
||||
|
||||
<m k="markColor" v="0|9">
|
||||
<symbol repeat="true" repeat-start="0" repeat-gap="24" src="assets:omdb/icon_2013_0.svg"></symbol>
|
||||
</m>
|
||||
</m>
|
||||
</m>
|
||||
<!--护栏-->
|
||||
<m k="boundaryType" v="4">
|
||||
<line stroke="#FFBC6E" use="boundaryType" width="0.1"/>
|
||||
<symbol repeat-gap="12" repeat="true" repeat-start="0" src="assets:omdb/icon_2013_4.svg" symbol-width="16" symbol-height="46"></symbol>
|
||||
</m>
|
||||
<!--路牙-->
|
||||
<m k="boundaryType" v="3">
|
||||
<symbol repeat="true" repeat-gap="10" repeat-start="0" src="assets:omdb/icon_2013_3.svg" symbol-width="16" symbol-height="10"></symbol>
|
||||
</m>
|
||||
|
||||
<m k="boundaryType" v="5|7">
|
||||
<line stroke="#ffffff" use="boundaryType" />
|
||||
</m>
|
||||
@ -1811,7 +1842,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>
|
||||
|
||||
<!-- 上方障碍物 -->
|
||||
|
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="b" xmlns="http://www.w3.org/2000/svg" width="197.9" height="198.5" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 197.9 198.5"><defs><style>.e{fill:#fad950;}.f{fill:#0a0a0a;}.g{fill:url(#d);stroke:#8b9fae;stroke-miterlimit:10;stroke-width:1.2px;}.h{fill:#535a60;opacity:0;}</style><linearGradient id="d" x1="57.2" y1="20.3" x2="140.7" y2="20.3" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#afbacb"/><stop offset=".1" stop-color="#c1ccda"/><stop offset=".4" stop-color="#d9e6f0"/><stop offset=".5" stop-color="#e3f0f8"/><stop offset=".6" stop-color="#dde9f2"/><stop offset=".8" stop-color="#ccd8e4"/><stop offset="1" stop-color="#b1bbcc"/><stop offset="1" stop-color="#aeb8c9"/></linearGradient></defs><g id="c"><g><rect class="h" y=".6" width="197.9" height="197.9"/><g><rect class="g" x="57.2" y=".6" width="83.4" height="39.3" rx="4.6" ry="4.6"/><g><path class="e" d="M62.4,4.4h73c1.4,0,2.6,1.1,2.6,2.6v28.8c0,1.4-1.1,2.6-2.6,2.6H62.4c-1.4,0-2.6-1.1-2.6-2.6V7c0-1.4,1.1-2.6,2.6-2.6Z"/><path class="f" d="M135.4,6.5c.3,0,.5,.2,.5,.5v28.8c0,.3-.2,.5-.5,.5H62.4c-.3,0-.5-.2-.5-.5V7c0-.3,.2-.5,.5-.5h73m0-4.1H62.4c-2.6,0-4.6,2.1-4.6,4.6v28.8c0,2.6,2.1,4.6,4.6,4.6h73c2.6,0,4.6-2.1,4.6-4.6V7c0-2.6-2.1-4.6-4.6-4.6h0Z"/></g><path d="M98.9,27.6c.7,0,1.3,.2,1.7,.7,.5,.5,.7,1,.7,1.7s-.2,1.2-.7,1.7c-.5,.5-1.1,.7-1.7,.7s-1.2-.2-1.7-.7c-.5-.5-.7-1-.7-1.7s.2-1.2,.7-1.7c.5-.5,1-.7,1.7-.7Zm2.1-17.3l-.5,15h-3.3l-.5-15h4.3Z"/></g></g></g></svg>
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><svg id="b" xmlns="http://www.w3.org/2000/svg" width="84.6" height="40.5" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 84.6 40.5"><defs><style>.e{fill:#fad950;}.f{fill:#0a0a0a;}.g{fill:url(#d);stroke:#8b9fae;stroke-miterlimit:10;stroke-width:1.2px;}</style><linearGradient id="d" x1=".6" y1="20.3" x2="84" y2="20.3" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#afbacb"/><stop offset=".1" stop-color="#c1ccda"/><stop offset=".4" stop-color="#d9e6f0"/><stop offset=".5" stop-color="#e3f0f8"/><stop offset=".6" stop-color="#dde9f2"/><stop offset=".8" stop-color="#ccd8e4"/><stop offset="1" stop-color="#b1bbcc"/><stop offset="1" stop-color="#aeb8c9"/></linearGradient></defs><g id="c"><g><rect class="g" x=".6" y=".6" width="83.4" height="39.3" rx="4.6" ry="4.6"/><g><rect class="e" x="3.2" y="4.4" width="78.1" height="33.9" rx="2.6" ry="2.6"/><path class="f" d="M78.8,6.5c.3,0,.5,.2,.5,.5v28.8c0,.3-.2,.5-.5,.5H5.8c-.3,0-.5-.2-.5-.5V7c0-.3,.2-.5,.5-.5H78.8m0-4.1H5.8C3.3,2.4,1.2,4.4,1.2,7v28.8c0,2.6,2.1,4.6,4.6,4.6H78.8c2.6,0,4.6-2.1,4.6-4.6V7c0-2.6-2.1-4.6-4.6-4.6h0Z"/></g><path d="M42.3,27.6c.7,0,1.3,.2,1.7,.7,.5,.5,.7,1,.7,1.7s-.2,1.2-.7,1.7c-.5,.5-1.1,.7-1.7,.7s-1.2-.2-1.7-.7c-.5-.5-.7-1-.7-1.7s.2-1.2,.7-1.7c.5-.5,1-.7,1.7-.7Zm2.1-17.3l-.5,15h-3.3l-.5-15h4.3Z"/></g></g></svg>
|
After Width: | Height: | Size: 1.3 KiB |
11
collect-library/src/main/assets/omdb/icon_2013_0.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1695622778812" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="8830" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="48" height="48">
|
||||
<path
|
||||
d="M284.444444 227.555556h739.555556L739.555556 796.444444H0L284.444444 227.555556z m26.368 42.666666l-241.777777 483.555556h644.152889l241.777777-483.555556H310.812444z"
|
||||
fill="#8e44ad" p-id="8831"></path>
|
||||
<path d="M310.812444 270.222222l-241.777777 483.555556h644.152889l241.777777-483.555556z"
|
||||
fill="#8e44ad" fill-opacity=".99" p-id="8832"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 730 B |
11
collect-library/src/main/assets/omdb/icon_2013_1.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1695622778812" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="8830" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="48" height="48">
|
||||
<path
|
||||
d="M284.444444 227.555556h739.555556L739.555556 796.444444H0L284.444444 227.555556z m26.368 42.666666l-241.777777 483.555556h644.152889l241.777777-483.555556H310.812444z"
|
||||
fill="#ffffff" p-id="8831"></path>
|
||||
<path d="M310.812444 270.222222l-241.777777 483.555556h644.152889l241.777777-483.555556z"
|
||||
fill="#ffffff" fill-opacity=".99" p-id="8832"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 730 B |
11
collect-library/src/main/assets/omdb/icon_2013_2.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1695622778812" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="8830" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="48" height="48">
|
||||
<path
|
||||
d="M284.444444 227.555556h739.555556L739.555556 796.444444H0L284.444444 227.555556z m26.368 42.666666l-241.777777 483.555556h644.152889l241.777777-483.555556H310.812444z"
|
||||
fill="#eccc68" p-id="8831"></path>
|
||||
<path d="M310.812444 270.222222l-241.777777 483.555556h644.152889l241.777777-483.555556z"
|
||||
fill="#eccc68" fill-opacity=".99" p-id="8832"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 730 B |
11
collect-library/src/main/assets/omdb/icon_2013_6.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1695622778812" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="8830" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="48" height="48">
|
||||
<path
|
||||
d="M284.444444 227.555556h739.555556L739.555556 796.444444H0L284.444444 227.555556z m26.368 42.666666l-241.777777 483.555556h644.152889l241.777777-483.555556H310.812444z"
|
||||
fill="#0000ff" p-id="8831"></path>
|
||||
<path d="M310.812444 270.222222l-241.777777 483.555556h644.152889l241.777777-483.555556z"
|
||||
fill="#0000ff" fill-opacity=".99" p-id="8832"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 730 B |
11
collect-library/src/main/assets/omdb/icon_2013_7.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg t="1695622778812" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="8830" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="48" height="48">
|
||||
<path
|
||||
d="M284.444444 227.555556h739.555556L739.555556 796.444444H0L284.444444 227.555556z m26.368 42.666666l-241.777777 483.555556h644.152889l241.777777-483.555556H310.812444z"
|
||||
fill="#00ff00" p-id="8831"></path>
|
||||
<path d="M310.812444 270.222222l-241.777777 483.555556h644.152889l241.777777-483.555556z"
|
||||
fill="#00ff00" fill-opacity=".99" p-id="8832"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 730 B |
BIN
collect-library/src/main/assets/omdb/icon_5001_0.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
collect-library/src/main/assets/omdb/icon_5001_1.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
@ -43,6 +43,8 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
*/
|
||||
private val mDefaultTextColor = "#4E55AF"
|
||||
|
||||
private var markerEnable = true
|
||||
|
||||
/**
|
||||
* 文字画笔
|
||||
*/
|
||||
@ -275,7 +277,12 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
// 设置矢量图层均在12级以上才显示
|
||||
mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
||||
if (e == Map.SCALE_EVENT) {
|
||||
qsRecordItemizedLayer.isEnabled = mapPosition.getZoomLevel() >= 12
|
||||
if(markerEnable){
|
||||
qsRecordItemizedLayer.isEnabled = mapPosition.getZoomLevel() >= 12
|
||||
}else{
|
||||
qsRecordItemizedLayer.isEnabled = false
|
||||
}
|
||||
|
||||
niLocationItemizedLayer.isEnabled = mapPosition.getZoomLevel() >= 12
|
||||
}
|
||||
})
|
||||
@ -372,6 +379,13 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
mMapView.updateMap(true)
|
||||
}
|
||||
|
||||
fun setQsRecordMarkEnable(enable:Boolean){
|
||||
qsRecordItemizedLayer.isEnabled = enable
|
||||
markerEnable = enable
|
||||
qsRecordItemizedLayer.populate()
|
||||
mMapView.updateMap(true)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 增加或更新便签
|
||||
|
@ -2,6 +2,7 @@ package com.navinfo.collect.library.utils;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import org.locationtech.jts.geom.Coordinate;
|
||||
@ -13,6 +14,8 @@ import org.locationtech.jts.geom.MultiPoint;
|
||||
import org.locationtech.jts.geom.MultiPolygon;
|
||||
import org.locationtech.jts.geom.Polygon;
|
||||
import org.locationtech.jts.io.WKTReader;
|
||||
import org.locationtech.jts.operation.buffer.BufferOp;
|
||||
import org.locationtech.jts.operation.buffer.BufferParameters;
|
||||
import org.locationtech.jts.operation.linemerge.LineMerger;
|
||||
import org.oscim.core.GeoPoint;
|
||||
import org.oscim.core.MercatorProjection;
|
||||
@ -1505,6 +1508,28 @@ public class GeometryTools {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param distLeft 单位km
|
||||
* @param distRight 单位km
|
||||
* @param wkt 几何
|
||||
* @return
|
||||
*/
|
||||
public static String computeLine(Double distLeft,Double distRight,String wkt){
|
||||
if(!TextUtils.isEmpty(wkt)){
|
||||
Geometry lineString1 = GeometryTools.createGeometry(wkt);
|
||||
BufferParameters parameters1 = new BufferParameters();
|
||||
parameters1.setEndCapStyle(BufferParameters.CAP_FLAT);
|
||||
parameters1.setSingleSided(true);
|
||||
|
||||
Geometry buffer = BufferOp.bufferOp(lineString1, distLeft, parameters1);
|
||||
Geometry buffer2 = BufferOp.bufferOp(lineString1, -distRight, parameters1);
|
||||
String bufferWkt = buffer.union(buffer2).toString();
|
||||
Log.e("qj",bufferWkt);
|
||||
return bufferWkt;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static FootAndDistance pointToLineDistance(GeoPoint point, Geometry geometry) {
|
||||
//定义垂线
|
||||
FootAndDistance pointPairDistance = new FootAndDistance(point);
|
||||
|
2
vtm
@ -1 +1 @@
|
||||
Subproject commit 719c44b65d3ed26d725b24b3a5366b281c9e4fad
|
||||
Subproject commit 271e7b22785b0570a34c50476e17a98dfcca7e71
|