Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
Conflicts: app/src/main/assets/omdb_config.json
This commit is contained in:
commit
fd2c5d0358
@ -23,7 +23,15 @@
|
||||
"2011": {
|
||||
"table": "OMDB_LINK_NAME",
|
||||
"code": 2011,
|
||||
"name": "道路名"
|
||||
"name": "道路名",
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
"v": "~",
|
||||
"klib": "geometry",
|
||||
"vlib": "generateRoadName()"
|
||||
}
|
||||
]
|
||||
},
|
||||
"2013": {
|
||||
"table": "OMDB_LANE_MARK_BOUNDARYTYPE",
|
||||
@ -88,6 +96,14 @@
|
||||
"code": 2202,
|
||||
"name": "隧道"
|
||||
},
|
||||
"4001": {
|
||||
"table": "OMDB_INTERSECTION",
|
||||
"code": 4001,
|
||||
"name": "路口",
|
||||
"transformer": [
|
||||
|
||||
]
|
||||
},
|
||||
"4002": {
|
||||
"table": "OMDB_SPEEDLIMIT",
|
||||
"code": 4002,
|
||||
@ -158,6 +174,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"4010":{
|
||||
"table": "OMDB_ELECTRONICEYE",
|
||||
"code": 4010,
|
||||
"name": "电子眼",
|
||||
"transformer": [
|
||||
|
||||
]
|
||||
},
|
||||
"4022": {
|
||||
"table": "OMDB_TRAFFICLIGHT",
|
||||
"code": 4022,
|
||||
@ -171,6 +195,14 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"4601":{
|
||||
"table": "OMDB_LANEINFO",
|
||||
"code": 4601,
|
||||
"name": "车信",
|
||||
"transformer": [
|
||||
|
||||
]
|
||||
},
|
||||
"5001":{
|
||||
"table": "OMDB_LANE_LINK_LG",
|
||||
"code": 5001,
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.navinfo.omqs
|
||||
|
||||
import com.navinfo.omqs.bean.ImportConfig
|
||||
|
||||
class Constant {
|
||||
companion object {
|
||||
/**
|
||||
@ -45,6 +47,11 @@ class Constant {
|
||||
*/
|
||||
lateinit var DOWNLOAD_PATH: String
|
||||
|
||||
/**
|
||||
* 图层管理对应的配置
|
||||
* */
|
||||
var LAYER_CONFIG_LIST: List<ImportConfig>? = null
|
||||
|
||||
const val DEBUG = true
|
||||
|
||||
var IS_VIDEO_SPEED by kotlin.properties.Delegates.notNull<Boolean>()
|
||||
|
@ -190,4 +190,31 @@ class ImportPreProcess {
|
||||
angleReference.properties["type"] = "angle"
|
||||
Realm.getDefaultInstance().insert(angleReference)
|
||||
}
|
||||
|
||||
fun generateRoadName(renderEntity: RenderEntity) {
|
||||
// LinkName的真正名称数据,是保存在properties的shapeList中的,因此需要解析shapeList数据
|
||||
var shape :JSONObject? = null
|
||||
if (renderEntity.properties.containsKey("shapeList")) {
|
||||
val shapeListJsonArray: JSONArray = JSONArray(renderEntity.properties["shapeList"])
|
||||
for (i in 0 until shapeListJsonArray.length()) {
|
||||
val shapeJSONObject = shapeListJsonArray.getJSONObject(i)
|
||||
if (shapeJSONObject["nameClass"]==1) {
|
||||
if (shape == null) {
|
||||
shape = shapeJSONObject
|
||||
}
|
||||
// 获取第一官方名
|
||||
//("名称分类"NAME_CLASS =“1 官方名”,且名称序号SEQ_NUM 最小者)
|
||||
if (shapeJSONObject["seqNum"].toString().toInt()< shape!!["seqNum"].toString().toInt()) {
|
||||
shape = shapeJSONObject
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 获取最小的shape值,将其记录增加记录在properties的name属性下
|
||||
if(shape!=null) {
|
||||
renderEntity.properties["name"] = shape["name"].toString()
|
||||
} else {
|
||||
renderEntity.properties["name"] = ""
|
||||
}
|
||||
}
|
||||
}
|
@ -15,16 +15,20 @@ class LayerConfigUtils {
|
||||
private val gson = Gson()
|
||||
|
||||
fun getLayerConfigList(): List<ImportConfig> {
|
||||
// 首先读取Shared文件,如果存在则直接返回,否则读取config文件
|
||||
return SPStaticUtils.getString(Constant.EVENT_LAYER_MANAGER_CHANGE, null).let {
|
||||
if (it != null) {
|
||||
val result: List<ImportConfig> =
|
||||
gson.fromJson(it, object : TypeToken<List<ImportConfig>>() {}.type)
|
||||
result
|
||||
} else {
|
||||
LayerConfigUtils.getLayerConfigListFromAssetsFile()
|
||||
}
|
||||
// 首先读取全局变量的数据,如果存在则直接返回,否则读取config文件
|
||||
if (Constant.LAYER_CONFIG_LIST == null) {
|
||||
Constant.LAYER_CONFIG_LIST = getLayerConfigListFromAssetsFile()
|
||||
}
|
||||
return Constant.LAYER_CONFIG_LIST!!
|
||||
// return SPStaticUtils.getString(Constant.EVENT_LAYER_MANAGER_CHANGE, null).let {
|
||||
// if (it != null) {
|
||||
// val result: List<ImportConfig> =
|
||||
// gson.fromJson(it, object : TypeToken<List<ImportConfig>>() {}.type)
|
||||
// result
|
||||
// } else {
|
||||
// LayerConfigUtils.getLayerConfigListFromAssetsFile()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private fun getLayerConfigListFromAssetsFile(): List<ImportConfig> {
|
||||
|
@ -23,7 +23,7 @@ class LayerManagerViewModel() : ViewModel() {
|
||||
}
|
||||
|
||||
fun saveLayerConfigList(context: Context, listData: List<ImportConfig>) {
|
||||
SPStaticUtils.put(Constant.EVENT_LAYER_MANAGER_CHANGE, gson.toJson(listData))
|
||||
Constant.LAYER_CONFIG_LIST = listData
|
||||
// 发送新的配置数据
|
||||
viewModelScope.launch {
|
||||
FlowEventBus.post(Constant.EVENT_LAYER_MANAGER_CHANGE, listData)
|
||||
|
@ -112,7 +112,7 @@ class PersonalCenterFragment(private var backListener: (() -> Unit?)? = null) :
|
||||
viewModel.readRealmData()
|
||||
// 定位到指定位置
|
||||
niMapController.mMapView.vtmMap.animator()
|
||||
.animateTo(GeoPoint( 40.034842306317486, 116.31735963074652 ))
|
||||
.animateTo(GeoPoint( 39.80392140200183, 116.51446703352337 ))
|
||||
}
|
||||
// R.id.personal_center_menu_task_list -> {
|
||||
// findNavController().navigate(R.id.TaskManagerFragment)
|
||||
|
@ -1803,5 +1803,9 @@
|
||||
width="0.1" />
|
||||
</m>
|
||||
</m>
|
||||
<!-- 道路名 -->
|
||||
<m v="OMDB_LINK_NAME">
|
||||
<text use="road"></text>
|
||||
</m>
|
||||
</m>
|
||||
</rendertheme>
|
Loading…
x
Reference in New Issue
Block a user