Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
Conflicts: app/src/main/assets/omdb_config.json app/src/main/java/com/navinfo/omqs/db/ImportOMDBHelper.kt app/src/main/java/com/navinfo/omqs/db/ImportPreProcess.kt
@ -126,11 +126,6 @@
|
|||||||
"zoomMin": 15,
|
"zoomMin": 15,
|
||||||
"zoomMax": 17
|
"zoomMax": 17
|
||||||
},
|
},
|
||||||
"2041": {
|
|
||||||
"table": "OMDB_LANE_NUM",
|
|
||||||
"code": 2041,
|
|
||||||
"name": "车道数"
|
|
||||||
},
|
|
||||||
"2083": {
|
"2083": {
|
||||||
"table": "OMDB_RDBOUND_BOUNDARYTYPE",
|
"table": "OMDB_RDBOUND_BOUNDARYTYPE",
|
||||||
"code": 2083,
|
"code": 2083,
|
||||||
|
@ -40,6 +40,13 @@ class Constant {
|
|||||||
*/
|
*/
|
||||||
lateinit var USER_DATA_PATH: String
|
lateinit var USER_DATA_PATH: String
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轨迹渲染个数统计
|
||||||
|
*/
|
||||||
|
var TRACE_COUNT : Int = 0
|
||||||
|
|
||||||
|
var TRACE_COUNT_TIME : Int = 10
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前安装任务
|
* 当前安装任务
|
||||||
*/
|
*/
|
||||||
@ -79,6 +86,11 @@ class Constant {
|
|||||||
*/
|
*/
|
||||||
lateinit var DOWNLOAD_PATH: String
|
lateinit var DOWNLOAD_PATH: String
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志目录
|
||||||
|
*/
|
||||||
|
lateinit var USER_DATA_LOG_PATH: String
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图层管理对应的配置
|
* 图层管理对应的配置
|
||||||
* */
|
* */
|
||||||
@ -107,6 +119,11 @@ class Constant {
|
|||||||
*/
|
*/
|
||||||
var MapMarkerCloseEnable = false
|
var MapMarkerCloseEnable = false
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轨迹显隐
|
||||||
|
*/
|
||||||
|
var MapTraceCloseEnable = false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否开启线捕捉
|
* 是否开启线捕捉
|
||||||
*/
|
*/
|
||||||
|
@ -8,6 +8,7 @@ import android.view.Surface
|
|||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import com.navinfo.omqs.tools.FileManager
|
import com.navinfo.omqs.tools.FileManager
|
||||||
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
||||||
|
import com.navinfo.omqs.util.CMLog
|
||||||
import com.navinfo.omqs.util.NetUtils
|
import com.navinfo.omqs.util.NetUtils
|
||||||
import com.umeng.commonsdk.UMConfigure
|
import com.umeng.commonsdk.UMConfigure
|
||||||
import dagger.hilt.android.HiltAndroidApp
|
import dagger.hilt.android.HiltAndroidApp
|
||||||
@ -20,6 +21,7 @@ class OMQSApplication : Application() {
|
|||||||
super.onCreate()
|
super.onCreate()
|
||||||
FileManager.initRootDir(this)
|
FileManager.initRootDir(this)
|
||||||
Util.getInstance().init(applicationContext)
|
Util.getInstance().init(applicationContext)
|
||||||
|
CMLog.getInstance().init(applicationContext)
|
||||||
NetUtils.getInstance().init(this)
|
NetUtils.getInstance().init(this)
|
||||||
TakePhotoManager.getInstance().init(this, 1)
|
TakePhotoManager.getInstance().init(this, 1)
|
||||||
// 初始化友盟统计
|
// 初始化友盟统计
|
||||||
|
@ -17,6 +17,7 @@ import com.navinfo.omqs.bean.ImportConfig
|
|||||||
import com.navinfo.omqs.bean.TableInfo
|
import com.navinfo.omqs.bean.TableInfo
|
||||||
import com.navinfo.omqs.db.deep.LinkList
|
import com.navinfo.omqs.db.deep.LinkList
|
||||||
import com.navinfo.omqs.hilt.OMDBDataBaseHiltFactory
|
import com.navinfo.omqs.hilt.OMDBDataBaseHiltFactory
|
||||||
|
import com.navinfo.omqs.util.CMLog
|
||||||
import dagger.assisted.Assisted
|
import dagger.assisted.Assisted
|
||||||
import dagger.assisted.AssistedInject
|
import dagger.assisted.AssistedInject
|
||||||
import io.realm.Realm
|
import io.realm.Realm
|
||||||
@ -324,31 +325,6 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderEntity.geometry = map["geometry"].toString()
|
renderEntity.geometry = map["geometry"].toString()
|
||||||
// Log.d("ImportOMDBHelper", "解析===1处理3D")
|
|
||||||
// 其他数据插入到Properties中
|
|
||||||
/* if (!currentConfig.is3D) { // 如果是非3d要素,则自动将Z轴坐标全部置为0
|
|
||||||
val coordinates =
|
|
||||||
renderEntity.wkt?.coordinates?.map { coordinate ->
|
|
||||||
coordinate.z = 0.0
|
|
||||||
coordinate
|
|
||||||
}?.toTypedArray()
|
|
||||||
var newGeometry: Geometry? = null
|
|
||||||
if (renderEntity.wkt?.geometryType == Geometry.TYPENAME_POINT) {
|
|
||||||
newGeometry = GeometryTools.createPoint(
|
|
||||||
coordinates!![0].x,
|
|
||||||
coordinates!![0].y
|
|
||||||
)
|
|
||||||
} else if (renderEntity.wkt?.geometryType == Geometry.TYPENAME_LINESTRING) {
|
|
||||||
newGeometry =
|
|
||||||
GeometryTools.createLineString(coordinates)
|
|
||||||
} else if (renderEntity.wkt?.geometryType == Geometry.TYPENAME_POLYGON) {
|
|
||||||
newGeometry =
|
|
||||||
GeometryTools.createLineString(coordinates)
|
|
||||||
}
|
|
||||||
if (newGeometry != null) {
|
|
||||||
renderEntity.geometry = newGeometry.toString()
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
for ((key, value) in map) {
|
for ((key, value) in map) {
|
||||||
when (value) {
|
when (value) {
|
||||||
is String -> renderEntity.properties[key] = value
|
is String -> renderEntity.properties[key] = value
|
||||||
@ -435,7 +411,6 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//遍历判断只显示与任务Link相关的任务数据
|
//遍历判断只显示与任务Link相关的任务数据
|
||||||
@ -495,19 +470,6 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
renderEntity.enable = 1
|
renderEntity.enable = 1
|
||||||
|
|
||||||
/* var geometry = GeometryTools.createGeometry(renderEntity.geometry)
|
|
||||||
if(multipLine.intersects(geometry)){
|
|
||||||
renderEntity.enable = 1
|
|
||||||
}else{
|
|
||||||
val dis = multipLine.distance(GeometryTools.createGeometry(renderEntity.geometry))
|
|
||||||
if(dis>36){
|
|
||||||
continue
|
|
||||||
}else{
|
|
||||||
renderEntity.enable = 1
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
// Log.e("qj", "${renderEntity.name}==不包括任务linkPid")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentConfig.catch) {
|
if (currentConfig.catch) {
|
||||||
@ -718,6 +680,12 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
renderEntity.linkRelation!!.eNodeId =
|
renderEntity.linkRelation!!.eNodeId =
|
||||||
renderEntity.properties["enodePid"]
|
renderEntity.properties["enodePid"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//去掉暂用控件较大的字段多余属性字段
|
||||||
|
if (renderEntity.properties.containsKey("shapeList")) {
|
||||||
|
renderEntity.properties.remove("shapeList")
|
||||||
|
}
|
||||||
|
|
||||||
renderEntity.propertiesDb = StrZipUtil.compress(
|
renderEntity.propertiesDb = StrZipUtil.compress(
|
||||||
gson.toJson(renderEntity.properties).toString()
|
gson.toJson(renderEntity.properties).toString()
|
||||||
)
|
)
|
||||||
|
@ -567,10 +567,12 @@ class ImportPreProcess {
|
|||||||
renderEntityTemp.catchEnable = renderEntity.catchEnable
|
renderEntityTemp.catchEnable = renderEntity.catchEnable
|
||||||
var dis = -lateralOffset.toDouble() / 100000000
|
var dis = -lateralOffset.toDouble() / 100000000
|
||||||
//最小值取10厘米,否正渲染太近无法显示
|
//最小值取10厘米,否正渲染太近无法显示
|
||||||
if (dis > 0 && dis < 0.0000028) {
|
if (dis > 0 && dis < 0.000005) {
|
||||||
dis = 0.0000028
|
dis = 0.000005
|
||||||
} else if (dis > -0.0000028 && dis < 0) {
|
Log.d("lateralOffset", "$dis")
|
||||||
dis = -0.0000028
|
} else if (dis > -0.000005 && dis < 0) {
|
||||||
|
dis = -0.000005
|
||||||
|
Log.d("lateralOffset", "$dis")
|
||||||
}
|
}
|
||||||
renderEntityTemp.geometry = GeometryTools.computeLine(
|
renderEntityTemp.geometry = GeometryTools.computeLine(
|
||||||
dis,
|
dis,
|
||||||
@ -739,10 +741,11 @@ class ImportPreProcess {
|
|||||||
// angleReference.renderEntityId = renderEntity.id
|
// angleReference.renderEntityId = renderEntity.id
|
||||||
angleReference.name = "${renderEntity.name}车道中线面"
|
angleReference.name = "${renderEntity.name}车道中线面"
|
||||||
angleReference.table = renderEntity.table
|
angleReference.table = renderEntity.table
|
||||||
|
Log.e("jingo", "几何转换开始")
|
||||||
angleReference.geometry =
|
angleReference.geometry =
|
||||||
GeometryTools.createGeometry(renderEntity.geometry).buffer(0.000035)
|
GeometryTools.createGeometry(renderEntity.geometry).buffer(0.000010)
|
||||||
.toString()//GeometryTools.computeLine(0.000035,0.000035,renderEntity.geometry)
|
.toString()//GeometryTools.computeLine(0.000035,0.000035,renderEntity.geometry)
|
||||||
|
Log.e("jingo", "几何转换结束")
|
||||||
angleReference.properties["qi_table"] = renderEntity.table
|
angleReference.properties["qi_table"] = renderEntity.table
|
||||||
angleReference.properties["widthProperties"] = "3"
|
angleReference.properties["widthProperties"] = "3"
|
||||||
angleReference.zoomMin = renderEntity.zoomMin
|
angleReference.zoomMin = renderEntity.zoomMin
|
||||||
|
@ -287,6 +287,12 @@ class LoginViewModel @Inject constructor(
|
|||||||
task.fileSize = item.fileSize
|
task.fileSize = item.fileSize
|
||||||
task.status = item.status
|
task.status = item.status
|
||||||
task.currentSize = item.currentSize
|
task.currentSize = item.currentSize
|
||||||
|
//增加mesh==null兼容性处理
|
||||||
|
for (hadLink in item.hadLinkDvoList) {
|
||||||
|
if(hadLink.mesh==null){
|
||||||
|
hadLink.mesh = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
task.hadLinkDvoList = item.hadLinkDvoList
|
task.hadLinkDvoList = item.hadLinkDvoList
|
||||||
task.syncStatus = item.syncStatus
|
task.syncStatus = item.syncStatus
|
||||||
//已上传后不在更新操作时间
|
//已上传后不在更新操作时间
|
||||||
@ -298,8 +304,10 @@ class LoginViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (hadLink in task.hadLinkDvoList) {
|
for (hadLink in task.hadLinkDvoList) {
|
||||||
if(hadLink.geometry==null||hadLink.mesh==null){
|
if(hadLink.geometry==null){
|
||||||
inSertData = false
|
inSertData = false
|
||||||
|
}else if(hadLink.mesh==null){
|
||||||
|
hadLink.mesh = ""
|
||||||
}else{
|
}else{
|
||||||
hadLink.taskId = task.id
|
hadLink.taskId = task.id
|
||||||
}
|
}
|
||||||
@ -423,12 +431,15 @@ class LoginViewModel @Inject constructor(
|
|||||||
Constant.VERSION_ID = userId
|
Constant.VERSION_ID = userId
|
||||||
Constant.USER_DATA_PATH = Constant.DATA_PATH + Constant.USER_ID + "/" + Constant.VERSION_ID
|
Constant.USER_DATA_PATH = Constant.DATA_PATH + Constant.USER_ID + "/" + Constant.VERSION_ID
|
||||||
Constant.USER_DATA_ATTACHEMNT_PATH = Constant.USER_DATA_PATH + "/attachment/"
|
Constant.USER_DATA_ATTACHEMNT_PATH = Constant.USER_DATA_PATH + "/attachment/"
|
||||||
|
Constant.USER_DATA_LOG_PATH = Constant.USER_DATA_PATH + "/log/"
|
||||||
// 在SD卡创建用户目录,解压资源等
|
// 在SD卡创建用户目录,解压资源等
|
||||||
val userFolder = File(Constant.USER_DATA_PATH)
|
val userFolder = File(Constant.USER_DATA_PATH)
|
||||||
if (!userFolder.exists()) userFolder.mkdirs()
|
if (!userFolder.exists()) userFolder.mkdirs()
|
||||||
//创建附件目录
|
//创建附件目录
|
||||||
val userAttachmentFolder = File(Constant.USER_DATA_ATTACHEMNT_PATH)
|
val userAttachmentFolder = File(Constant.USER_DATA_ATTACHEMNT_PATH)
|
||||||
if (!userAttachmentFolder.exists()) userAttachmentFolder.mkdirs()
|
if (!userAttachmentFolder.exists()) userAttachmentFolder.mkdirs()
|
||||||
|
val userLogFolder = File(Constant.USER_DATA_LOG_PATH)
|
||||||
|
if (!userLogFolder.exists()) userLogFolder.mkdirs()
|
||||||
// 初始化Realm
|
// 初始化Realm
|
||||||
Realm.init(context.applicationContext)
|
Realm.init(context.applicationContext)
|
||||||
// 656e6372797000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
// 656e6372797000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
@ -344,7 +344,7 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
viewModel.liveDataAutoLocation.observe(this) {
|
viewModel.liveDataAutoLocation.observe(this) {
|
||||||
if (it == true) {
|
if (it == true&&Constant.INDOOR_IP==null|| Constant.INDOOR_IP == "") {
|
||||||
onClickLocation()
|
onClickLocation()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -844,6 +844,7 @@ class MainActivity : BaseActivity() {
|
|||||||
*/
|
*/
|
||||||
fun setTopMenuButtonVisibility(visibility: Int) {
|
fun setTopMenuButtonVisibility(visibility: Int) {
|
||||||
binding.mainActivityMenu.visibility = visibility
|
binding.mainActivityMenu.visibility = visibility
|
||||||
|
binding.mainActivityStatusCamera.visibility = visibility
|
||||||
if (visibility != View.VISIBLE) {
|
if (visibility != View.VISIBLE) {
|
||||||
binding.mainActivityMenuGroup.visibility = View.INVISIBLE
|
binding.mainActivityMenuGroup.visibility = View.INVISIBLE
|
||||||
binding.mainActivityMenu.isSelected = false
|
binding.mainActivityMenu.isSelected = false
|
||||||
|
@ -23,6 +23,7 @@ import androidx.lifecycle.ViewModel
|
|||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import androidx.navigation.findNavController
|
import androidx.navigation.findNavController
|
||||||
import com.blankj.utilcode.util.ToastUtils
|
import com.blankj.utilcode.util.ToastUtils
|
||||||
|
import com.google.gson.Gson
|
||||||
import com.navinfo.collect.library.data.dao.impl.TraceDataBase
|
import com.navinfo.collect.library.data.dao.impl.TraceDataBase
|
||||||
import com.navinfo.collect.library.data.entity.*
|
import com.navinfo.collect.library.data.entity.*
|
||||||
import com.navinfo.collect.library.enums.DataCodeEnum
|
import com.navinfo.collect.library.enums.DataCodeEnum
|
||||||
@ -250,6 +251,8 @@ class MainViewModel @Inject constructor(
|
|||||||
private val naviMutex = Mutex()
|
private val naviMutex = Mutex()
|
||||||
private var testRealm: Realm? = null;
|
private var testRealm: Realm? = null;
|
||||||
|
|
||||||
|
private var traceCount = 0
|
||||||
|
|
||||||
init {
|
init {
|
||||||
mapController.mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
mapController.mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
||||||
when (e) {
|
when (e) {
|
||||||
@ -563,7 +566,14 @@ class MainViewModel @Inject constructor(
|
|||||||
).niLocationDao.findToTaskIdAll(id.toString())
|
).niLocationDao.findToTaskIdAll(id.toString())
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
for (location in list) {
|
for (location in list) {
|
||||||
|
Constant.TRACE_COUNT++
|
||||||
|
|
||||||
mapController.markerHandle.addNiLocationMarkerItem(location)
|
mapController.markerHandle.addNiLocationMarkerItem(location)
|
||||||
|
|
||||||
|
if(Constant.TRACE_COUNT%Constant.TRACE_COUNT_TIME==0){
|
||||||
|
mapController.markerHandle.addNiLocationMarkerItemSimple(location)
|
||||||
|
Log.e("qj","$traceCount===轨迹")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -572,6 +582,7 @@ class MainViewModel @Inject constructor(
|
|||||||
* 初始化定位信息
|
* 初始化定位信息
|
||||||
*/
|
*/
|
||||||
private fun initLocation() {
|
private fun initLocation() {
|
||||||
|
var gson = Gson();
|
||||||
|
|
||||||
//用于定位点存储到数据库
|
//用于定位点存储到数据库
|
||||||
viewModelScope.launch(Dispatchers.Default) {
|
viewModelScope.launch(Dispatchers.Default) {
|
||||||
@ -627,10 +638,18 @@ class MainViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
//室内整理工具时不能进行轨迹存储,判断轨迹间隔要超过2.5并小于60米
|
//室内整理工具时不能进行轨迹存储,判断轨迹间隔要超过2.5并小于60米
|
||||||
if (Constant.INDOOR_IP.isEmpty() && (disance == 0.0 || (disance > 2.5 && disance < 60))) {
|
if (Constant.INDOOR_IP.isEmpty() && (disance == 0.0 || (disance > 2.5 && disance < 60))) {
|
||||||
|
traceCount ++
|
||||||
|
Log.e("jingo", "轨迹插入开始")
|
||||||
|
CMLog.writeLogtoFile(MainViewModel::class.java.name,"insertTrace","开始")
|
||||||
traceDataBase.niLocationDao.insert(location)
|
traceDataBase.niLocationDao.insert(location)
|
||||||
mapController.markerHandle.addNiLocationMarkerItem(location)
|
mapController.markerHandle.addNiLocationMarkerItem(location)
|
||||||
|
if(Constant.TRACE_COUNT%Constant.TRACE_COUNT_TIME==0){
|
||||||
|
mapController.markerHandle.addNiLocationMarkerItemSimple(location)
|
||||||
|
}
|
||||||
mapController.mMapView.vtmMap.updateMap(true)
|
mapController.mMapView.vtmMap.updateMap(true)
|
||||||
lastNiLocaion = location
|
lastNiLocaion = location
|
||||||
|
CMLog.writeLogtoFile(MainViewModel::class.java.name,"insertTrace",gson.toJson(location))
|
||||||
|
Log.e("jingo", "轨迹插入结束")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1022,7 +1041,7 @@ class MainViewModel @Inject constructor(
|
|||||||
fun onClickLocationButton() {
|
fun onClickLocationButton() {
|
||||||
val mapPosition: MapPosition = mapController.mMapView.vtmMap.getMapPosition()
|
val mapPosition: MapPosition = mapController.mMapView.vtmMap.getMapPosition()
|
||||||
mapPosition.setBearing(0f) // 锁定角度,自动将地图旋转到正北方向
|
mapPosition.setBearing(0f) // 锁定角度,自动将地图旋转到正北方向
|
||||||
mapController.mMapView.vtmMap.setMapPosition(mapPosition)
|
mapController.mMapView.vtmMap.mapPosition = mapPosition
|
||||||
mapController.locationLayerHandler.animateToCurrentPosition()
|
mapController.locationLayerHandler.animateToCurrentPosition()
|
||||||
naviEngineStatus = 1
|
naviEngineStatus = 1
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,8 @@ class SignAdapter(private var listener: OnSignAdapterClickListener?) :
|
|||||||
override fun getItemViewType(position: Int): Int {
|
override fun getItemViewType(position: Int): Int {
|
||||||
if (data.isNotEmpty() && data[position].renderEntity.code == DataCodeEnum.OMDB_LANEINFO.code) {
|
if (data.isNotEmpty() && data[position].renderEntity.code == DataCodeEnum.OMDB_LANEINFO.code) {
|
||||||
return 4601
|
return 4601
|
||||||
|
}else if (data.isNotEmpty() && data[position].renderEntity.code == DataCodeEnum.OMDB_CLM_LANEINFO.code) {
|
||||||
|
return 4602
|
||||||
} else if (data.isNotEmpty() && data[position].renderEntity.code == DataCodeEnum.OMDB_TOLLGATE.code) {
|
} else if (data.isNotEmpty() && data[position].renderEntity.code == DataCodeEnum.OMDB_TOLLGATE.code) {
|
||||||
return 4023
|
return 4023
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import android.net.Uri
|
|||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.TimePicker
|
import android.widget.TimePicker
|
||||||
@ -21,6 +22,7 @@ import com.blankj.utilcode.util.UriUtils
|
|||||||
import com.github.k1rakishou.fsaf.FileChooser
|
import com.github.k1rakishou.fsaf.FileChooser
|
||||||
import com.github.k1rakishou.fsaf.callback.FSAFActivityCallbacks
|
import com.github.k1rakishou.fsaf.callback.FSAFActivityCallbacks
|
||||||
import com.github.k1rakishou.fsaf.callback.FileChooserCallback
|
import com.github.k1rakishou.fsaf.callback.FileChooserCallback
|
||||||
|
import com.google.android.material.internal.NavigationMenuItemView
|
||||||
import com.google.android.material.timepicker.MaterialTimePicker
|
import com.google.android.material.timepicker.MaterialTimePicker
|
||||||
import com.navinfo.collect.library.enums.DataLayerEnum
|
import com.navinfo.collect.library.enums.DataLayerEnum
|
||||||
import com.navinfo.collect.library.map.NIMapController
|
import com.navinfo.collect.library.map.NIMapController
|
||||||
@ -40,6 +42,7 @@ import com.permissionx.guolindev.PermissionX
|
|||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import org.oscim.core.GeoPoint
|
import org.oscim.core.GeoPoint
|
||||||
import org.oscim.core.MapPosition
|
import org.oscim.core.MapPosition
|
||||||
|
import org.oscim.utils.MinHeap.Item
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,7 +76,7 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
|||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
binding.root.setNavigationItemSelectedListener {
|
binding.root.setNavigationItemSelectedListener { it ->
|
||||||
when (it.itemId) {
|
when (it.itemId) {
|
||||||
R.id.personal_center_menu_offline_map ->
|
R.id.personal_center_menu_offline_map ->
|
||||||
findNavController().navigate(R.id.OfflineMapFragment)
|
findNavController().navigate(R.id.OfflineMapFragment)
|
||||||
@ -151,7 +154,7 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
|||||||
val mapPosition: MapPosition =
|
val mapPosition: MapPosition =
|
||||||
niMapController.mMapView.vtmMap.getMapPosition()
|
niMapController.mMapView.vtmMap.getMapPosition()
|
||||||
mapPosition.setBearing(0f) // 锁定角度,自动将地图旋转到正北方向
|
mapPosition.setBearing(0f) // 锁定角度,自动将地图旋转到正北方向
|
||||||
niMapController.mMapView.vtmMap.setMapPosition(mapPosition)
|
niMapController.mMapView.vtmMap.mapPosition = mapPosition
|
||||||
it.title = "开启地图旋转及视角"
|
it.title = "开启地图旋转及视角"
|
||||||
} else {
|
} else {
|
||||||
it.title = "锁定地图旋转及视角"
|
it.title = "锁定地图旋转及视角"
|
||||||
@ -168,6 +171,17 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
|||||||
it.title = "隐藏Marker"
|
it.title = "隐藏Marker"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
R.id.personal_center_menu_trace -> {
|
||||||
|
Constant.MapTraceCloseEnable = !Constant.MapTraceCloseEnable
|
||||||
|
//增加开关控制
|
||||||
|
niMapController.markerHandle.setTraceMarkEnable(!Constant.MapTraceCloseEnable)
|
||||||
|
//增加开关控制
|
||||||
|
if (Constant.MapTraceCloseEnable) {
|
||||||
|
it.title = "显示轨迹"
|
||||||
|
} else {
|
||||||
|
it.title = "隐藏轨迹"
|
||||||
|
}
|
||||||
|
}
|
||||||
R.id.personal_center_menu_catch_all -> {
|
R.id.personal_center_menu_catch_all -> {
|
||||||
Constant.CATCH_ALL = !Constant.CATCH_ALL
|
Constant.CATCH_ALL = !Constant.CATCH_ALL
|
||||||
if (Constant.CATCH_ALL) {
|
if (Constant.CATCH_ALL) {
|
||||||
@ -258,6 +272,13 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
|||||||
it.title = "隐藏Marker"
|
it.title = "隐藏Marker"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
R.id.personal_center_menu_trace -> {
|
||||||
|
if (Constant.MapTraceCloseEnable) {
|
||||||
|
it.title = "显示轨迹"
|
||||||
|
} else {
|
||||||
|
it.title = "隐藏轨迹"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,9 @@ class TaskFragment : BaseFragment() {
|
|||||||
viewModel.liveDataAddLinkDialog.observe(viewLifecycleOwner){
|
viewModel.liveDataAddLinkDialog.observe(viewLifecycleOwner){
|
||||||
viewModel.addTaskLink(requireContext(),it)
|
viewModel.addTaskLink(requireContext(),it)
|
||||||
}
|
}
|
||||||
|
viewModel.liveDataUpdateTask.observe(viewLifecycleOwner) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//注意:使用滑动菜单不能开启滑动删除,否则只有滑动删除没有滑动菜单
|
//注意:使用滑动菜单不能开启滑动删除,否则只有滑动删除没有滑动菜单
|
||||||
val mSwipeMenuCreator = SwipeMenuCreator { _, rightMenu, _ ->
|
val mSwipeMenuCreator = SwipeMenuCreator { _, rightMenu, _ ->
|
||||||
|
@ -89,8 +89,15 @@ class TaskListFragment : BaseFragment() {
|
|||||||
deleteItem.background = requireContext().getDrawable(R.color.red)
|
deleteItem.background = requireContext().getDrawable(R.color.red)
|
||||||
deleteItem.setTextColor(requireContext().resources.getColor(R.color.white))
|
deleteItem.setTextColor(requireContext().resources.getColor(R.color.white))
|
||||||
rightMenu.addMenuItem(deleteItem)
|
rightMenu.addMenuItem(deleteItem)
|
||||||
}
|
|
||||||
|
|
||||||
|
val resetDownLoad = SwipeMenuItem(context)
|
||||||
|
resetDownLoad.height = Util.convertDpToPx(requireContext(), 60)
|
||||||
|
resetDownLoad.width = Util.convertDpToPx(requireContext(), 80)
|
||||||
|
resetDownLoad.text = "重新下载"
|
||||||
|
resetDownLoad.background = requireContext().getDrawable(R.color.btn_bg_blue)
|
||||||
|
resetDownLoad.setTextColor(requireContext().resources.getColor(R.color.white))
|
||||||
|
rightMenu.addMenuItem(resetDownLoad)
|
||||||
|
}
|
||||||
|
|
||||||
val layoutManager = LinearLayoutManager(context)
|
val layoutManager = LinearLayoutManager(context)
|
||||||
//// 设置 RecyclerView 的固定大小,避免在滚动时重新计算视图大小和布局,提高性能
|
//// 设置 RecyclerView 的固定大小,避免在滚动时重新计算视图大小和布局,提高性能
|
||||||
@ -104,11 +111,15 @@ class TaskListFragment : BaseFragment() {
|
|||||||
binding.taskListRecyclerview.setOnItemMenuClickListener { menuBridge, position ->
|
binding.taskListRecyclerview.setOnItemMenuClickListener { menuBridge, position ->
|
||||||
menuBridge.closeMenu()
|
menuBridge.closeMenu()
|
||||||
val taskBean = adapter.data[position]
|
val taskBean = adapter.data[position]
|
||||||
if (taskBean.syncStatus != FileManager.Companion.FileUploadStatus.DONE) {
|
if(menuBridge.position==0){
|
||||||
Toast.makeText(context, "数据未上传,不允许关闭!", Toast.LENGTH_SHORT)
|
if (taskBean.syncStatus != FileManager.Companion.FileUploadStatus.DONE) {
|
||||||
.show()
|
Toast.makeText(context, "数据未上传,不允许关闭!", Toast.LENGTH_SHORT)
|
||||||
} else {
|
.show()
|
||||||
viewModel.removeTask(requireContext(), taskBean)
|
} else {
|
||||||
|
viewModel.removeTask(requireContext(), taskBean)
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
viewModel.resetDownload(requireContext(), taskBean)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,6 +145,28 @@ class TaskListFragment : BaseFragment() {
|
|||||||
binding.taskListRecyclerview.smoothScrollToPosition(position)
|
binding.taskListRecyclerview.smoothScrollToPosition(position)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.liveDataCloseTask.observe(viewLifecycleOwner){
|
||||||
|
when(it){
|
||||||
|
TaskDelStatus.TASK_DEL_STATUS_BEGIN->{
|
||||||
|
showLoadingDialog("正在重置...")
|
||||||
|
}
|
||||||
|
TaskDelStatus.TASK_DEL_STATUS_LOADING->{
|
||||||
|
showLoadingDialog("正在重置...")
|
||||||
|
}
|
||||||
|
TaskDelStatus.TASK_DEL_STATUS_SUCCESS->{
|
||||||
|
hideLoadingDialog()
|
||||||
|
Toast.makeText(context,"成功重置",Toast.LENGTH_LONG).show()
|
||||||
|
|
||||||
|
}
|
||||||
|
TaskDelStatus.TASK_DEL_STATUS_FAILED->{
|
||||||
|
hideLoadingDialog()
|
||||||
|
}
|
||||||
|
TaskDelStatus.TASK_DEL_STATUS_CANCEL->{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//监听并调用上传
|
//监听并调用上传
|
||||||
viewModel.liveDataTaskUpload.observe(viewLifecycleOwner) {
|
viewModel.liveDataTaskUpload.observe(viewLifecycleOwner) {
|
||||||
for ((key, value) in it) {
|
for ((key, value) in it) {
|
||||||
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
|
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
@ -31,6 +32,32 @@ import org.oscim.core.GeoPoint
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
enum class TaskDelStatus {
|
||||||
|
/**
|
||||||
|
* 删除开始
|
||||||
|
*/
|
||||||
|
TASK_DEL_STATUS_BEGIN,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除中
|
||||||
|
*/
|
||||||
|
TASK_DEL_STATUS_LOADING,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除成功
|
||||||
|
*/
|
||||||
|
TASK_DEL_STATUS_SUCCESS,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除失败
|
||||||
|
*/
|
||||||
|
TASK_DEL_STATUS_FAILED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消删除
|
||||||
|
*/
|
||||||
|
TASK_DEL_STATUS_CANCEL,
|
||||||
|
}
|
||||||
|
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
class TaskViewModel @Inject constructor(
|
class TaskViewModel @Inject constructor(
|
||||||
@ -61,7 +88,12 @@ class TaskViewModel @Inject constructor(
|
|||||||
/**
|
/**
|
||||||
* 用来确定是否关闭
|
* 用来确定是否关闭
|
||||||
*/
|
*/
|
||||||
val liveDataCloseTask = MutableLiveData<Boolean>()
|
val liveDataCloseTask = MutableLiveData<TaskDelStatus>()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用来更新任务
|
||||||
|
*/
|
||||||
|
val liveDataUpdateTask = MutableLiveData<TaskBean>()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提示信息
|
* 提示信息
|
||||||
@ -126,7 +158,8 @@ class TaskViewModel @Inject constructor(
|
|||||||
} else {
|
} else {
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
val realm = realmOperateHelper.getSelectTaskRealmInstance()
|
val realm = realmOperateHelper.getSelectTaskRealmInstance()
|
||||||
val links = realmOperateHelper.queryLink(realm,
|
val links = realmOperateHelper.queryLink(
|
||||||
|
realm,
|
||||||
point = point,
|
point = point,
|
||||||
)
|
)
|
||||||
if (links.isNotEmpty()) {
|
if (links.isNotEmpty()) {
|
||||||
@ -179,6 +212,13 @@ class TaskViewModel @Inject constructor(
|
|||||||
task.fileSize = item.fileSize
|
task.fileSize = item.fileSize
|
||||||
task.status = item.status
|
task.status = item.status
|
||||||
task.currentSize = item.currentSize
|
task.currentSize = item.currentSize
|
||||||
|
//增加mesh==null兼容性处理
|
||||||
|
for (hadLink in item.hadLinkDvoList) {
|
||||||
|
if (hadLink.mesh == null) {
|
||||||
|
hadLink.mesh = ""
|
||||||
|
Log.e("qj", "${task.id}==null")
|
||||||
|
}
|
||||||
|
}
|
||||||
task.hadLinkDvoList = item.hadLinkDvoList
|
task.hadLinkDvoList = item.hadLinkDvoList
|
||||||
task.syncStatus = item.syncStatus
|
task.syncStatus = item.syncStatus
|
||||||
//已上传后不在更新操作时间
|
//已上传后不在更新操作时间
|
||||||
@ -191,11 +231,16 @@ class TaskViewModel @Inject constructor(
|
|||||||
} else {
|
} else {
|
||||||
for (hadLink in task.hadLinkDvoList) {
|
for (hadLink in task.hadLinkDvoList) {
|
||||||
hadLink.taskId = task.id
|
hadLink.taskId = task.id
|
||||||
|
if (hadLink.mesh == null) {
|
||||||
|
hadLink.mesh = ""
|
||||||
|
Log.e("qj", "${task.id}==新增==null")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//赋值时间,用于查询过滤
|
//赋值时间,用于查询过滤
|
||||||
task.operationTime = DateTimeUtil.getNowDate().time
|
task.operationTime = DateTimeUtil.getNowDate().time
|
||||||
}
|
}
|
||||||
it.copyToRealmOrUpdate(task)
|
Log.e("qj", "${task.id}")
|
||||||
|
realm.copyToRealmOrUpdate(task)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,16 +318,28 @@ class TaskViewModel @Inject constructor(
|
|||||||
|
|
||||||
liveDataTaskLinks.value = taskBean.hadLinkDvoList
|
liveDataTaskLinks.value = taskBean.hadLinkDvoList
|
||||||
showTaskLinks(taskBean)
|
showTaskLinks(taskBean)
|
||||||
|
//重新加载轨迹
|
||||||
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
Constant.TRACE_COUNT = 0
|
||||||
|
val list: List<NiLocation>? = TraceDataBase.getDatabase(
|
||||||
|
mapController.mMapView.context, Constant.USER_DATA_PATH
|
||||||
|
).niLocationDao.findToTaskIdAll(taskBean.id.toString())
|
||||||
|
list!!.forEach {
|
||||||
|
|
||||||
|
Constant.TRACE_COUNT ++
|
||||||
|
|
||||||
|
mapController.markerHandle.addNiLocationMarkerItem(it)
|
||||||
|
|
||||||
|
if(Constant.TRACE_COUNT%Constant.TRACE_COUNT_TIME==0){
|
||||||
|
mapController.markerHandle.addNiLocationMarkerItemSimple(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
MapParamUtils.setTaskId(taskBean.id)
|
MapParamUtils.setTaskId(taskBean.id)
|
||||||
Constant.currentSelectTaskFolder = File(Constant.USER_DATA_PATH + "/${taskBean.id}")
|
Constant.currentSelectTaskFolder = File(Constant.USER_DATA_PATH + "/${taskBean.id}")
|
||||||
Constant.currentSelectTaskConfig =
|
Constant.currentSelectTaskConfig =
|
||||||
RealmConfiguration.Builder()
|
RealmConfiguration.Builder().directory(Constant.currentSelectTaskFolder)
|
||||||
.directory(Constant.currentSelectTaskFolder)
|
.name("OMQS.realm").encryptionKey(Constant.PASSWORD).allowQueriesOnUiThread(true)
|
||||||
.name("OMQS.realm")
|
|
||||||
.encryptionKey(Constant.PASSWORD)
|
|
||||||
// .assetFile("${Constant.currentSelectTaskFolder}/OMQS.realm")
|
|
||||||
// .readOnly()
|
|
||||||
//.allowQueriesOnUiThread(true)
|
|
||||||
.schemaVersion(2).build()
|
.schemaVersion(2).build()
|
||||||
MapParamUtils.setTaskConfig(Constant.currentSelectTaskConfig)
|
MapParamUtils.setTaskConfig(Constant.currentSelectTaskConfig)
|
||||||
mapController.layerManagerHandler.updateOMDBVectorTileLayer()
|
mapController.layerManagerHandler.updateOMDBVectorTileLayer()
|
||||||
@ -416,6 +473,71 @@ class TaskViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重新下载数据任务
|
||||||
|
*/
|
||||||
|
fun resetDownload(context: Context, taskBean: TaskBean) {
|
||||||
|
val mDialog = FirstDialog(context)
|
||||||
|
mDialog.setTitle("提示?")
|
||||||
|
mDialog.setMessage("是否重置下载状态,请确认!")
|
||||||
|
mDialog.setPositiveButton(
|
||||||
|
"确定"
|
||||||
|
) { dialog, _ ->
|
||||||
|
dialog.dismiss()
|
||||||
|
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_BEGIN)
|
||||||
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
//删除已下载的数据
|
||||||
|
val fileTemp =
|
||||||
|
File("${Constant.DOWNLOAD_PATH}${taskBean.evaluationTaskName}_${taskBean.dataVersion}.zip")
|
||||||
|
if (fileTemp.exists()) {
|
||||||
|
fileTemp.delete()
|
||||||
|
}
|
||||||
|
val taskFileTemp = File(Constant.USER_DATA_PATH + "/${taskBean.id}")
|
||||||
|
//重命名
|
||||||
|
if (taskFileTemp.exists()) {
|
||||||
|
/* var currentSelectTaskFolder = File(Constant.USER_DATA_PATH + "/${taskBean.id}")
|
||||||
|
var currentSelectTaskConfig =
|
||||||
|
RealmConfiguration.Builder().directory(currentSelectTaskFolder)
|
||||||
|
.name("OMQS.realm").encryptionKey(Constant.PASSWORD)
|
||||||
|
.allowQueriesOnUiThread(true)
|
||||||
|
.schemaVersion(2).build()
|
||||||
|
Realm.getInstance(currentSelectTaskConfig).executeTransaction { r ->
|
||||||
|
//删除已有所有数据
|
||||||
|
r.delete(RenderEntity::class.java)
|
||||||
|
r.delete(ReferenceEntity::class.java)
|
||||||
|
}
|
||||||
|
Realm.getInstance(currentSelectTaskConfig).close()*/
|
||||||
|
}
|
||||||
|
//将下载状态修改已下载
|
||||||
|
val realm = realmOperateHelper.getRealmDefaultInstance()
|
||||||
|
taskBean.syncStatus = FileManager.Companion.FileUploadStatus.NONE
|
||||||
|
taskBean.status = FileManager.Companion.FileDownloadStatus.NONE
|
||||||
|
realm.beginTransaction()
|
||||||
|
realm.copyToRealmOrUpdate(taskBean)
|
||||||
|
realm.commitTransaction()
|
||||||
|
realm.close()
|
||||||
|
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_SUCCESS)
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
if (taskBean.id == currentSelectTaskBean?.id ?: 0) {
|
||||||
|
mapController.layerManagerHandler.updateOMDBVectorTileLayer()
|
||||||
|
} else {
|
||||||
|
setSelectTaskBean(taskBean)
|
||||||
|
}
|
||||||
|
realmOperateHelper.getRealmDefaultInstance().refresh()
|
||||||
|
//重新加载数据
|
||||||
|
getLocalTaskList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mDialog.setNegativeButton(
|
||||||
|
"取消"
|
||||||
|
) { _, _ ->
|
||||||
|
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_CANCEL)
|
||||||
|
mDialog.dismiss()
|
||||||
|
}
|
||||||
|
mDialog.show()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关闭任务
|
* 关闭任务
|
||||||
*/
|
*/
|
||||||
@ -427,7 +549,9 @@ class TaskViewModel @Inject constructor(
|
|||||||
"确定"
|
"确定"
|
||||||
) { dialog, _ ->
|
) { dialog, _ ->
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_BEGIN)
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_LOADING)
|
||||||
val realm = realmOperateHelper.getRealmDefaultInstance()
|
val realm = realmOperateHelper.getRealmDefaultInstance()
|
||||||
realm.executeTransaction {
|
realm.executeTransaction {
|
||||||
val objects =
|
val objects =
|
||||||
@ -461,14 +585,14 @@ class TaskViewModel @Inject constructor(
|
|||||||
FileManager.checkOMDBFileInfo(item)
|
FileManager.checkOMDBFileInfo(item)
|
||||||
}
|
}
|
||||||
liveDataTaskList.postValue(taskList)
|
liveDataTaskList.postValue(taskList)
|
||||||
liveDataCloseTask.postValue(true)
|
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_SUCCESS)
|
||||||
realm.close()
|
realm.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mDialog.setNegativeButton(
|
mDialog.setNegativeButton(
|
||||||
"取消"
|
"取消"
|
||||||
) { _, _ ->
|
) { _, _ ->
|
||||||
liveDataCloseTask.postValue(false)
|
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_CANCEL)
|
||||||
mDialog.dismiss()
|
mDialog.dismiss()
|
||||||
}
|
}
|
||||||
mDialog.show()
|
mDialog.show()
|
||||||
|
349
app/src/main/java/com/navinfo/omqs/util/CMLog.java
Normal file
@ -0,0 +1,349 @@
|
|||||||
|
package com.navinfo.omqs.util;
|
||||||
|
|
||||||
|
import android.app.ActivityManager;
|
||||||
|
import android.app.ActivityManager.MemoryInfo;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.navinfo.omqs.Constant;
|
||||||
|
|
||||||
|
import java.io.BufferedWriter;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 带日志文件输入的,又可控开关的日志调试
|
||||||
|
*
|
||||||
|
* @author qj
|
||||||
|
* @version 1.0
|
||||||
|
* @data 2016-8-23
|
||||||
|
*/
|
||||||
|
public class CMLog {
|
||||||
|
//CrashHandler实例
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static CMLog instance;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static Boolean MYLOG_SWITCH = true; //日志文件总开关
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static Boolean MYLOG_WRITE_TO_FILE = true;//日志写入文件开关
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static char MYLOG_TYPE = 'v';//输入日志类型,w代表只输出告警信息等,v代表输出所有信息
|
||||||
|
// private static String MYLOG_PATH_SDCARD_DIR = FMConstant.USER_DATA_LOG_PATH;// 日志文件在sdcard中的路径
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static int SDCARD_LOG_FILE_SAVE_DAYS = 0;// sd卡中日志文件的最多保存天数
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static String MYLOGFILEName = "Log.txt";// 本类输出的日志文件名称
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static String STACKLOGFILEName = "StackLog.txt";// 本类输出的日志文件名称
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static SimpleDateFormat myLogSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//日志的输出格式
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static SimpleDateFormat logfile = new SimpleDateFormat("yyyy-MM-dd-HH");//日志文件格式
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static Context mContext;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static boolean flag;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static int count = 0;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取CrashHandler实例 ,单例模式
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static CMLog getInstance() {
|
||||||
|
if (instance == null)
|
||||||
|
instance = new CMLog();
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化
|
||||||
|
* @param context
|
||||||
|
*/
|
||||||
|
public void init(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tag
|
||||||
|
* @param msg
|
||||||
|
*/
|
||||||
|
public static void w(String tag, Object msg) {//警告信息
|
||||||
|
log(tag, msg.toString(), 'w');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tag
|
||||||
|
* @param msg
|
||||||
|
*/
|
||||||
|
public static void e(String tag, Object msg) {//错误信息
|
||||||
|
log(tag, msg.toString(), 'e');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tag
|
||||||
|
* @param msg
|
||||||
|
*/
|
||||||
|
public static void d(String tag, Object msg) {//调试信息
|
||||||
|
log(tag, msg.toString(), 'd');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tag
|
||||||
|
* @param msg
|
||||||
|
*/
|
||||||
|
public static void i(String tag, Object msg) {//
|
||||||
|
log(tag, msg.toString(), 'i');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tag
|
||||||
|
* @param msg
|
||||||
|
*/
|
||||||
|
public static void v(String tag, Object msg) {
|
||||||
|
log(tag, msg.toString(), 'v');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tag
|
||||||
|
* @param text
|
||||||
|
*/
|
||||||
|
public static void w(String tag, String text) {
|
||||||
|
log(tag, text, 'w');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tag
|
||||||
|
* @param text
|
||||||
|
*/
|
||||||
|
public static void e(String tag, String text) {
|
||||||
|
log(tag, text, 'e');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tag
|
||||||
|
* @param text
|
||||||
|
*/
|
||||||
|
public static void d(String tag, String text) {
|
||||||
|
log(tag, text, 'd');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tag
|
||||||
|
* @param text
|
||||||
|
*/
|
||||||
|
public static void i(String tag, String text) {
|
||||||
|
log(tag, text, 'i');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tag
|
||||||
|
* @param text
|
||||||
|
*/
|
||||||
|
public static void v(String tag, String text) {
|
||||||
|
log(tag, text, 'v');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据tag, msg和等级,输出日志
|
||||||
|
*
|
||||||
|
* @param tag
|
||||||
|
* @param msg
|
||||||
|
* @param level
|
||||||
|
* @return void
|
||||||
|
* @since v 1.0
|
||||||
|
*/
|
||||||
|
private static void log(String tag, String msg, char level) {
|
||||||
|
if (MYLOG_SWITCH) {
|
||||||
|
if ('e' == level && ('e' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) { // 输出错误信息
|
||||||
|
Log.e(tag, msg);
|
||||||
|
} else if ('w' == level && ('w' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
|
||||||
|
Log.w(tag, msg);
|
||||||
|
} else if ('d' == level && ('d' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
|
||||||
|
Log.d(tag, msg);
|
||||||
|
} else if ('i' == level && ('d' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
|
||||||
|
Log.i(tag, msg);
|
||||||
|
} else {
|
||||||
|
Log.v(tag, msg);
|
||||||
|
}
|
||||||
|
if (MYLOG_WRITE_TO_FILE)
|
||||||
|
writeLogtoFile(String.valueOf(level), tag, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开日志文件并写入日志
|
||||||
|
*
|
||||||
|
* @param mylogtype
|
||||||
|
* @param tag
|
||||||
|
* @param text
|
||||||
|
**/
|
||||||
|
public static void writeLogtoFile(String mylogtype, String tag, String text) {
|
||||||
|
if (!flag&&MYLOG_WRITE_TO_FILE) {
|
||||||
|
flag = true;
|
||||||
|
try {
|
||||||
|
Log.e("jingo", "日志写入0");
|
||||||
|
// 新建或打开日志文件
|
||||||
|
Date nowtime = new Date();
|
||||||
|
String needWriteFiel = logfile.format(nowtime);
|
||||||
|
// String needWriteMessage = myLogSdf.format(nowtime) + " " + mylogtype
|
||||||
|
String needWriteMessage = simpleDateFormat.format(nowtime) + " " + mylogtype
|
||||||
|
+ " " + count + " " + tag + " " + text + "\r\n";
|
||||||
|
//输出内存使用情况
|
||||||
|
ActivityManager activityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
|
||||||
|
MemoryInfo memoryInfo = new MemoryInfo();
|
||||||
|
activityManager.getMemoryInfo(memoryInfo);
|
||||||
|
/* needWriteMessage += " 系统剩余内存: " + (memoryInfo.availMem / 1024) + "(KB)\n";
|
||||||
|
needWriteMessage += " 系统是否处于低内存运行: " + memoryInfo.lowMemory + "\n";
|
||||||
|
needWriteMessage += " 当系统剩余内存低于: " + (memoryInfo.threshold / 1024) + "(KB)\n";*/
|
||||||
|
if (new File(Constant.USER_DATA_LOG_PATH).exists() == false) {
|
||||||
|
new File(Constant.USER_DATA_LOG_PATH).mkdirs();
|
||||||
|
}
|
||||||
|
File file = new File(Constant.USER_DATA_LOG_PATH, needWriteFiel + MYLOGFILEName);
|
||||||
|
Log.e("jingo", "日志写入1");
|
||||||
|
|
||||||
|
if (!file.exists())
|
||||||
|
file.createNewFile();
|
||||||
|
Log.e("jingo", "日志写入2");
|
||||||
|
|
||||||
|
FileWriter filerWriter = new FileWriter(file, true);//后面这个参数代表是不是要接上文件中原来的数据,不进行覆盖
|
||||||
|
BufferedWriter bufWriter = new BufferedWriter(filerWriter);
|
||||||
|
bufWriter.write(needWriteMessage);
|
||||||
|
bufWriter.newLine();
|
||||||
|
bufWriter.close();
|
||||||
|
filerWriter.close();
|
||||||
|
Log.e("jingo", "日志写入结束");
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
count ++;
|
||||||
|
|
||||||
|
if(count>10000){
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 写入调用栈的信息,包括文件名,行号,接口名称
|
||||||
|
*
|
||||||
|
* @param extMsg 扩展信息,如果不为NULL,则输出到栈信息之前
|
||||||
|
*/
|
||||||
|
public static void writeStackLogtoFile(String extMsg) {// 新建或打开日志文件
|
||||||
|
StackTraceElement[] eles = Thread.currentThread().getStackTrace();
|
||||||
|
Date nowtime = new Date();
|
||||||
|
String needWriteFiel = logfile.format(nowtime);
|
||||||
|
String needWriteMessage = "[Java Stack]:" + myLogSdf.format(nowtime) + "\n";
|
||||||
|
|
||||||
|
if(eles!=null&&eles.length>3){
|
||||||
|
needWriteMessage += "\t file name :" + eles[3].getFileName() + "\n";
|
||||||
|
needWriteMessage += "\t line num :" + eles[3].getLineNumber() + "\n";
|
||||||
|
needWriteMessage += "\t class name:" + eles[3].getClassName() + "\n";
|
||||||
|
needWriteMessage += "\t method :" + eles[3].getMethodName() + "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (extMsg != null && extMsg.length() > 0) {
|
||||||
|
needWriteMessage += "\t extMsg :" + extMsg + "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (new File(Constant.USER_DATA_LOG_PATH).exists() == false) {
|
||||||
|
new File(Constant.USER_DATA_LOG_PATH).mkdirs();
|
||||||
|
}
|
||||||
|
File file = new File(Constant.USER_DATA_LOG_PATH, needWriteFiel
|
||||||
|
+ STACKLOGFILEName);
|
||||||
|
try {
|
||||||
|
FileWriter filerWriter = new FileWriter(file, true);//后面这个参数代表是不是要接上文件中原来的数据,不进行覆盖
|
||||||
|
BufferedWriter bufWriter = new BufferedWriter(filerWriter);
|
||||||
|
bufWriter.write(needWriteMessage);
|
||||||
|
bufWriter.newLine();
|
||||||
|
bufWriter.close();
|
||||||
|
filerWriter.close();
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除制定的日志文件
|
||||||
|
*/
|
||||||
|
public static void delFile() {// 删除日志文件
|
||||||
|
String needDelFiel = logfile.format(getDateBefore());
|
||||||
|
File file = new File(Constant.USER_DATA_LOG_PATH, needDelFiel + MYLOGFILEName);
|
||||||
|
if (file.exists()) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 得到现在时间前的几天日期,用来得到需要删除的日志文件名
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static Date getDateBefore() {
|
||||||
|
Date nowtime = new Date();
|
||||||
|
Calendar now = Calendar.getInstance();
|
||||||
|
now.setTime(nowtime);
|
||||||
|
now.set(Calendar.DATE, now.get(Calendar.DATE)
|
||||||
|
- SDCARD_LOG_FILE_SAVE_DAYS);
|
||||||
|
return now.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
//输出错误日志
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 得到现在时间前的几天日期,用来得到需要删除的日志文件名
|
||||||
|
* @param e
|
||||||
|
* @param TAG
|
||||||
|
*/
|
||||||
|
public static void writeStackLogtoFile(Exception e, String TAG) {
|
||||||
|
String errorInfo = "";
|
||||||
|
for (int i = 0; i < e.getStackTrace().length; i++) {
|
||||||
|
errorInfo += e.getStackTrace()[i];
|
||||||
|
}
|
||||||
|
writeLogtoFile("异常崩溃", "异常", "异常信息:" + errorInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param mylogWriteToFile
|
||||||
|
*/
|
||||||
|
public static void setMylogWriteToFile(Boolean mylogWriteToFile) {
|
||||||
|
MYLOG_WRITE_TO_FILE = mylogWriteToFile;
|
||||||
|
}
|
||||||
|
}
|
@ -75,6 +75,7 @@ class NaviEngine(
|
|||||||
DataCodeEnum.OMDB_TRAFFICLIGHT.name,
|
DataCodeEnum.OMDB_TRAFFICLIGHT.name,
|
||||||
// DataCodeEnum.OMDB_RESTRICTION.name,
|
// DataCodeEnum.OMDB_RESTRICTION.name,
|
||||||
DataCodeEnum.OMDB_LANEINFO.name,
|
DataCodeEnum.OMDB_LANEINFO.name,
|
||||||
|
DataCodeEnum.OMDB_CLM_LANEINFO.name,
|
||||||
DataCodeEnum.OMDB_TRAFFIC_SIGN.name,
|
DataCodeEnum.OMDB_TRAFFIC_SIGN.name,
|
||||||
DataCodeEnum.OMDB_WARNINGSIGN.name,
|
DataCodeEnum.OMDB_WARNINGSIGN.name,
|
||||||
DataCodeEnum.OMDB_TOLLGATE.name
|
DataCodeEnum.OMDB_TOLLGATE.name
|
||||||
|
@ -107,7 +107,7 @@ class SignUtil {
|
|||||||
//物理车道数OMDB_PHY_LANENUM
|
//物理车道数OMDB_PHY_LANENUM
|
||||||
DataCodeEnum.OMDB_LANE_NUM.code,
|
DataCodeEnum.OMDB_LANE_NUM.code,
|
||||||
DataCodeEnum.OMDB_PHY_LANENUM.code -> {
|
DataCodeEnum.OMDB_PHY_LANENUM.code -> {
|
||||||
"${data.properties["laneNum"]}|${data.properties["laneS2e"]}|${data.properties["laneE2s"]}"
|
"${data.properties["laneS2e"]}|${data.properties["laneE2s"]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
//常规点限速,条件点限速
|
//常规点限速,条件点限速
|
||||||
@ -286,11 +286,11 @@ class SignUtil {
|
|||||||
//车道数//增加物理车道数DataCodeEnum.OMDB_PHY_LANENUM.code
|
//车道数//增加物理车道数DataCodeEnum.OMDB_PHY_LANENUM.code
|
||||||
DataCodeEnum.OMDB_PHY_LANENUM.code,
|
DataCodeEnum.OMDB_PHY_LANENUM.code,
|
||||||
DataCodeEnum.OMDB_LANE_NUM.code -> {
|
DataCodeEnum.OMDB_LANE_NUM.code -> {
|
||||||
list.add(
|
/* list.add(
|
||||||
TwoItemAdapterItem(
|
TwoItemAdapterItem(
|
||||||
title = "车道总数", text = "${data.properties["laneNum"]}"
|
title = "车道总数", text = "${data.properties["laneNum"]}"
|
||||||
)
|
)
|
||||||
)
|
)*/
|
||||||
list.add(
|
list.add(
|
||||||
TwoItemAdapterItem(
|
TwoItemAdapterItem(
|
||||||
title = "顺方向车道数", text = "${data.properties["laneS2e"]}"
|
title = "顺方向车道数", text = "${data.properties["laneS2e"]}"
|
||||||
@ -1426,14 +1426,14 @@ class SignUtil {
|
|||||||
)
|
)
|
||||||
DataCodeEnum.OMDB_RD_LINK_KIND.code -> stringBuffer.append("种别${item.iconText},")
|
DataCodeEnum.OMDB_RD_LINK_KIND.code -> stringBuffer.append("种别${item.iconText},")
|
||||||
DataCodeEnum.OMDB_LINK_DIRECT.code -> stringBuffer.append("${item.iconText},")
|
DataCodeEnum.OMDB_LINK_DIRECT.code -> stringBuffer.append("${item.iconText},")
|
||||||
DataCodeEnum.OMDB_PHY_LANENUM.code,//物理车道数
|
/* DataCodeEnum.OMDB_PHY_LANENUM.code,//物理车道数
|
||||||
DataCodeEnum.OMDB_LANE_NUM.code -> stringBuffer.append(
|
DataCodeEnum.OMDB_LANE_NUM.code -> stringBuffer.append(
|
||||||
"${
|
"${
|
||||||
item.iconText.substringBefore(
|
item.iconText.substringBefore(
|
||||||
"|"
|
"|"
|
||||||
)
|
)
|
||||||
}车道"
|
}车道"
|
||||||
)
|
)*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return stringBuffer.toString()
|
return stringBuffer.toString()
|
||||||
|
@ -48,12 +48,17 @@
|
|||||||
android:title="锁定地图旋转及视角" />
|
android:title="锁定地图旋转及视角" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/personal_center_menu_marker"
|
android:id="@+id/personal_center_menu_marker"
|
||||||
android:icon="@drawable/baseline_person_24"
|
android:icon="@drawable/baseline_map_24"
|
||||||
android:visible="true"
|
android:visible="true"
|
||||||
android:title="隐藏Marker" />
|
android:title="隐藏Marker" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/personal_center_menu_trace"
|
||||||
|
android:icon="@drawable/baseline_map_24"
|
||||||
|
android:visible="true"
|
||||||
|
android:title="隐藏轨迹" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/personal_center_menu_catch_all"
|
android:id="@+id/personal_center_menu_catch_all"
|
||||||
android:icon="@drawable/baseline_person_24"
|
android:icon="@drawable/baseline_map_24"
|
||||||
android:visible="true"
|
android:visible="true"
|
||||||
android:title="全要素捕捉" />
|
android:title="全要素捕捉" />
|
||||||
<item
|
<item
|
||||||
|
@ -1558,7 +1558,11 @@
|
|||||||
<symbol repeat="false" repeat-start="0" repeat-gap="2000"
|
<symbol repeat="false" repeat-start="0" repeat-gap="2000"
|
||||||
src="@symbol" symbol-height="24" degree="90"></symbol>
|
src="@symbol" symbol-height="24" degree="90"></symbol>
|
||||||
</m>
|
</m>
|
||||||
|
<!-- 车信CLM -->
|
||||||
|
<m v="OMDB_CLM_LANEINFO" >
|
||||||
|
<symbol repeat="false" repeat-start="0" repeat-gap="2000"
|
||||||
|
src="@symbol" symbol-height="24" degree="90"></symbol>
|
||||||
|
</m>
|
||||||
<!-- 杆状物 -->
|
<!-- 杆状物 -->
|
||||||
<m v="OMDB_POLE">
|
<m v="OMDB_POLE">
|
||||||
<symbol src="assets:omdb/icon_pole_3006.svg" symbol-height="56" symbol-width="56"></symbol>
|
<symbol src="assets:omdb/icon_pole_3006.svg" symbol-height="56" symbol-width="56"></symbol>
|
||||||
@ -1720,22 +1724,22 @@
|
|||||||
<m k="markType" v="6">
|
<m k="markType" v="6">
|
||||||
<!--其他|实线-->
|
<!--其他|实线-->
|
||||||
<m k="markColor" v="1">
|
<m k="markColor" v="1">
|
||||||
<symbol repeat="true" repeat-start="0" repeat-gap="24" src="assets:omdb/icon_2013_1.svg"/>
|
<symbol repeat="true" repeat-start="0" repeat-gap="32" symbol-height="8" symbol-width="8" src="assets:omdb/icon_2013_1.svg"/>
|
||||||
</m>
|
</m>
|
||||||
<m k="markColor" v="2">
|
<m k="markColor" v="2">
|
||||||
<symbol repeat="true" repeat-start="0" repeat-gap="24" src="assets:omdb/icon_2013_2.svg"></symbol>
|
<symbol repeat="true" repeat-start="0" repeat-gap="32" symbol-height="8" symbol-width="8" src="assets:omdb/icon_2013_2.svg"></symbol>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m k="markColor" v="6">
|
<m k="markColor" v="6">
|
||||||
<symbol repeat="true" repeat-start="0" repeat-gap="24" src="assets:omdb/icon_2013_6.svg"></symbol>
|
<symbol repeat="true" repeat-start="0" repeat-gap="32" symbol-height="8" symbol-width="8" src="assets:omdb/icon_2013_6.svg"></symbol>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m k="markColor" v="7">
|
<m k="markColor" v="7">
|
||||||
<symbol repeat="true" repeat-start="0" repeat-gap="24" src="assets:omdb/icon_2013_7.svg"></symbol>
|
<symbol repeat="true" repeat-start="0" repeat-gap="32" symbol-height="8" symbol-width="8" src="assets:omdb/icon_2013_7.svg"></symbol>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
<m k="markColor" v="0|9">
|
<m k="markColor" v="0|9">
|
||||||
<symbol repeat="true" repeat-start="0" repeat-gap="24" src="assets:omdb/icon_2013_0.svg"></symbol>
|
<symbol repeat="true" repeat-start="0" repeat-gap="32" symbol-height="8" symbol-width="8" src="assets:omdb/icon_2013_0.svg"></symbol>
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="136.1" height="113.4"
|
||||||
<svg t="1695622778812" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
viewBox="0 0 136.1 113.4">
|
||||||
xmlns="http://www.w3.org/2000/svg" p-id="8830" xmlns:xlink="http://www.w3.org/1999/xlink"
|
<g id="c">
|
||||||
width="48" height="48">
|
<g>
|
||||||
<path
|
<rect width="136.1" height="113.4" style="fill:none;" />
|
||||||
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"
|
<polygon points="109.7 56.7 0 56.7 26.4 0 136.1 0 109.7 56.7" style="fill:#8e44ad;" />
|
||||||
fill="#8e44ad" p-id="8831"></path>
|
</g>
|
||||||
<path d="M310.812444 270.222222l-241.777777 483.555556h644.152889l241.777777-483.555556z"
|
</g>
|
||||||
fill="#8e44ad" fill-opacity=".99" p-id="8832"></path>
|
|
||||||
</svg>
|
</svg>
|
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 369 B |
@ -1,11 +1,10 @@
|
|||||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="136.1" height="113.4"
|
||||||
<svg t="1695622778812" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
viewBox="0 0 136.1 113.4">
|
||||||
xmlns="http://www.w3.org/2000/svg" p-id="8830" xmlns:xlink="http://www.w3.org/1999/xlink"
|
<g id="c">
|
||||||
width="48" height="48">
|
<g>
|
||||||
<path
|
<rect width="136.1" height="113.4" style="fill:none;" />
|
||||||
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"
|
<polygon points="109.7 56.7 0 56.7 26.4 0 136.1 0 109.7 56.7" style="fill:#fff;" />
|
||||||
fill="#ffffff" p-id="8831"></path>
|
</g>
|
||||||
<path d="M310.812444 270.222222l-241.777777 483.555556h644.152889l241.777777-483.555556z"
|
</g>
|
||||||
fill="#ffffff" fill-opacity=".99" p-id="8832"></path>
|
|
||||||
</svg>
|
</svg>
|
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 366 B |
@ -1,11 +1,10 @@
|
|||||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="136.1" height="113.4"
|
||||||
<svg t="1695622778812" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
viewBox="0 0 136.1 113.4">
|
||||||
xmlns="http://www.w3.org/2000/svg" p-id="8830" xmlns:xlink="http://www.w3.org/1999/xlink"
|
<g id="c">
|
||||||
width="48" height="48">
|
<g>
|
||||||
<path
|
<rect width="136.1" height="113.4" style="fill:none;" />
|
||||||
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"
|
<polygon points="109.7 56.7 0 56.7 26.4 0 136.1 0 109.7 56.7" style="fill:#eccc68;" />
|
||||||
fill="#eccc68" p-id="8831"></path>
|
</g>
|
||||||
<path d="M310.812444 270.222222l-241.777777 483.555556h644.152889l241.777777-483.555556z"
|
</g>
|
||||||
fill="#eccc68" fill-opacity=".99" p-id="8832"></path>
|
|
||||||
</svg>
|
</svg>
|
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 369 B |
@ -1,11 +1,10 @@
|
|||||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="136.1" height="113.4"
|
||||||
<svg t="1695622778812" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
viewBox="0 0 136.1 113.4">
|
||||||
xmlns="http://www.w3.org/2000/svg" p-id="8830" xmlns:xlink="http://www.w3.org/1999/xlink"
|
<g id="c">
|
||||||
width="48" height="48">
|
<g>
|
||||||
<path
|
<rect width="136.1" height="113.4" style="fill:none;" />
|
||||||
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"
|
<polygon points="109.7 56.7 0 56.7 26.4 0 136.1 0 109.7 56.7" style="fill:#0000ff;" />
|
||||||
fill="#0000ff" p-id="8831"></path>
|
</g>
|
||||||
<path d="M310.812444 270.222222l-241.777777 483.555556h644.152889l241.777777-483.555556z"
|
</g>
|
||||||
fill="#0000ff" fill-opacity=".99" p-id="8832"></path>
|
|
||||||
</svg>
|
</svg>
|
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 369 B |
@ -1,11 +1,10 @@
|
|||||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="136.1" height="113.4"
|
||||||
<svg t="1695622778812" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
viewBox="0 0 136.1 113.4">
|
||||||
xmlns="http://www.w3.org/2000/svg" p-id="8830" xmlns:xlink="http://www.w3.org/1999/xlink"
|
<g id="c">
|
||||||
width="48" height="48">
|
<g>
|
||||||
<path
|
<rect width="136.1" height="113.4" style="fill:none;" />
|
||||||
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"
|
<polygon points="109.7 56.7 0 56.7 26.4 0 136.1 0 109.7 56.7" style="fill:#00ff00;" />
|
||||||
fill="#00ff00" p-id="8831"></path>
|
</g>
|
||||||
<path d="M310.812444 270.222222l-241.777777 483.555556h644.152889l241.777777-483.555556z"
|
</g>
|
||||||
fill="#00ff00" fill-opacity=".99" p-id="8832"></path>
|
|
||||||
</svg>
|
</svg>
|
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 369 B |
@ -1,5 +1,7 @@
|
|||||||
package com.navinfo.collect.library.data.entity
|
package com.navinfo.collect.library.data.entity
|
||||||
|
|
||||||
|
import com.navinfo.collect.library.utils.GeometryTools
|
||||||
|
import com.navinfo.collect.library.utils.GeometryToolsKt
|
||||||
import io.realm.RealmObject
|
import io.realm.RealmObject
|
||||||
import io.realm.annotations.PrimaryKey
|
import io.realm.annotations.PrimaryKey
|
||||||
|
|
||||||
@ -12,11 +14,13 @@ open class HadLinkDvoBean @JvmOverloads constructor(
|
|||||||
* 图幅号
|
* 图幅号
|
||||||
*/
|
*/
|
||||||
var mesh: String = "",
|
var mesh: String = "",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* linkPid
|
* linkPid
|
||||||
*/
|
*/
|
||||||
@PrimaryKey
|
@PrimaryKey
|
||||||
var linkPid: String = "",
|
var linkPid: String = "",
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (几何)加偏后
|
* (几何)加偏后
|
||||||
*/
|
*/
|
||||||
@ -31,10 +35,12 @@ open class HadLinkDvoBean @JvmOverloads constructor(
|
|||||||
* 1:源库link,2:选择link 3:现场新增
|
* 1:源库link,2:选择link 3:现场新增
|
||||||
*/
|
*/
|
||||||
var linkStatus: Int = 1,
|
var linkStatus: Int = 1,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详细属性
|
* 详细属性
|
||||||
*/
|
*/
|
||||||
var linkInfo: LinkInfoBean? = null,
|
var linkInfo: LinkInfoBean? = null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 长度(米)
|
* 长度(米)
|
||||||
*/
|
*/
|
||||||
|
@ -81,6 +81,7 @@ enum class DataCodeEnum(var tableName: String, var code: String) {
|
|||||||
OMDB_TRAFFICLIGHT("交通灯", "4022"),
|
OMDB_TRAFFICLIGHT("交通灯", "4022"),
|
||||||
OMDB_TOLLGATE("收费站", "4023"),
|
OMDB_TOLLGATE("收费站", "4023"),
|
||||||
OMDB_LANEINFO("车信", "4601"),
|
OMDB_LANEINFO("车信", "4601"),
|
||||||
|
OMDB_CLM_LANEINFO("车信CLM", "4602"),
|
||||||
OMDB_LANE_LINK_LG("车道中心线", "5001");
|
OMDB_LANE_LINK_LG("车道中心线", "5001");
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -608,6 +608,7 @@ public final class NIMapView extends RelativeLayout {
|
|||||||
LABEL(4)/*图标,文字图层*/,
|
LABEL(4)/*图标,文字图层*/,
|
||||||
OPERATE_LINE(5)/*操作图层组*/,
|
OPERATE_LINE(5)/*操作图层组*/,
|
||||||
OPERATE_MARKER(6)/*操作图层组*/;
|
OPERATE_MARKER(6)/*操作图层组*/;
|
||||||
|
|
||||||
int groupIndex;
|
int groupIndex;
|
||||||
|
|
||||||
LAYER_GROUPS(int groupIndex) {
|
LAYER_GROUPS(int groupIndex) {
|
||||||
|
@ -171,7 +171,7 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
mCurrentLocation?.run {
|
mCurrentLocation?.run {
|
||||||
val mapPosition = mMapView.vtmMap.mapPosition
|
val mapPosition = mMapView.vtmMap.mapPosition
|
||||||
mapPosition.setPosition(this.latitude, this.longitude)
|
mapPosition.setPosition(this.latitude, this.longitude)
|
||||||
mMapView.vtmMap.animator().animateTo(300, mapPosition)
|
mMapView.vtmMap.animator().animateTo(800, mapPosition)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ import org.oscim.backend.canvas.Paint
|
|||||||
import org.oscim.core.GeoPoint
|
import org.oscim.core.GeoPoint
|
||||||
import org.oscim.layers.marker.*
|
import org.oscim.layers.marker.*
|
||||||
import org.oscim.layers.marker.ItemizedLayer.OnItemGestureListener
|
import org.oscim.layers.marker.ItemizedLayer.OnItemGestureListener
|
||||||
|
import org.oscim.layers.tile.vector.VectorTileLayer
|
||||||
|
import org.oscim.layers.vector.VectorLayer
|
||||||
import org.oscim.layers.vector.geometries.*
|
import org.oscim.layers.vector.geometries.*
|
||||||
import org.oscim.map.Map
|
import org.oscim.map.Map
|
||||||
import java.util.*
|
import java.util.*
|
||||||
@ -43,8 +45,17 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
*/
|
*/
|
||||||
private val mDefaultTextColor = "#4E55AF"
|
private val mDefaultTextColor = "#4E55AF"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认Marker可用状态
|
||||||
|
*/
|
||||||
private var markerEnable = true
|
private var markerEnable = true
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认轨迹可用状态
|
||||||
|
*/
|
||||||
|
private var traceMarkerEnable = true
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文字画笔
|
* 文字画笔
|
||||||
*/
|
*/
|
||||||
@ -179,6 +190,45 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
layer
|
layer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 评测精简数据marker 图层
|
||||||
|
*/
|
||||||
|
private val niLocationItemizedLayerSimple: ItemizedLayer by lazy {
|
||||||
|
|
||||||
|
val symbol = MarkerSymbol(niLocationBitmap, MarkerSymbol.HotspotPlace.CENTER)
|
||||||
|
val layerSimple = ItemizedLayer(
|
||||||
|
mapView.vtmMap,
|
||||||
|
symbol,
|
||||||
|
)
|
||||||
|
layerSimple.setOnItemGestureListener(object : OnItemGestureListener<MarkerInterface> {
|
||||||
|
override fun onItemSingleTapUp(index: Int, item: MarkerInterface?): Boolean {
|
||||||
|
val tag = mMapView.listenerTagList.last()
|
||||||
|
val listenerList = mMapView.listenerList[tag]
|
||||||
|
if (listenerList != null) {
|
||||||
|
for (listener in listenerList) {
|
||||||
|
/* if (listener is OnNiLocationItemListener) {
|
||||||
|
listener.onNiLocation(
|
||||||
|
tag,
|
||||||
|
index,
|
||||||
|
(niLocationItemizedLayerSimple.itemList[index] as MarkerItem).uid as NiLocation
|
||||||
|
)
|
||||||
|
break
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onItemLongPress(index: Int, item: MarkerInterface?): Boolean {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
addLayer(layerSimple, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
|
||||||
|
layerSimple
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 评测数据marker 图层
|
* 评测数据marker 图层
|
||||||
*/
|
*/
|
||||||
@ -213,7 +263,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
layer.isEnabled = false
|
||||||
addLayer(layer, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
|
addLayer(layer, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
|
||||||
layer
|
layer
|
||||||
}
|
}
|
||||||
@ -277,13 +327,18 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
// 设置矢量图层均在12级以上才显示
|
// 设置矢量图层均在12级以上才显示
|
||||||
mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
||||||
if (e == Map.SCALE_EVENT) {
|
if (e == Map.SCALE_EVENT) {
|
||||||
if(markerEnable){
|
if (markerEnable) {
|
||||||
qsRecordItemizedLayer.isEnabled = mapPosition.getZoomLevel() >= 12
|
qsRecordItemizedLayer.isEnabled = mapPosition.getZoomLevel() >= 12
|
||||||
}else{
|
} else {
|
||||||
qsRecordItemizedLayer.isEnabled = false
|
qsRecordItemizedLayer.isEnabled = false
|
||||||
}
|
}
|
||||||
|
if (traceMarkerEnable) {
|
||||||
niLocationItemizedLayer.isEnabled = mapPosition.getZoomLevel() >= 12
|
niLocationItemizedLayer.isEnabled = mapPosition.getZoomLevel() in 17..20
|
||||||
|
niLocationItemizedLayerSimple.isEnabled = mapPosition.getZoomLevel() in 12..16
|
||||||
|
} else {
|
||||||
|
niLocationItemizedLayer.isEnabled = false
|
||||||
|
niLocationItemizedLayerSimple.isEnabled = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -379,13 +434,28 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
mMapView.updateMap(true)
|
mMapView.updateMap(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setQsRecordMarkEnable(enable:Boolean){
|
/**
|
||||||
|
* Marker是否显示
|
||||||
|
*/
|
||||||
|
fun setQsRecordMarkEnable(enable: Boolean) {
|
||||||
qsRecordItemizedLayer.isEnabled = enable
|
qsRecordItemizedLayer.isEnabled = enable
|
||||||
markerEnable = enable
|
markerEnable = enable
|
||||||
qsRecordItemizedLayer.populate()
|
qsRecordItemizedLayer.populate()
|
||||||
mMapView.updateMap(true)
|
mMapView.updateMap(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轨迹是否显示
|
||||||
|
*/
|
||||||
|
fun setTraceMarkEnable(enable: Boolean) {
|
||||||
|
niLocationItemizedLayer.isEnabled = enable
|
||||||
|
niLocationItemizedLayerSimple.isEnabled = enable
|
||||||
|
traceMarkerEnable = enable
|
||||||
|
niLocationItemizedLayer.populate()
|
||||||
|
niLocationItemizedLayerSimple.populate()
|
||||||
|
mMapView.updateMap(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加或更新便签
|
* 增加或更新便签
|
||||||
@ -520,11 +590,18 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
* 添加质检数据marker
|
* 添加质检数据marker
|
||||||
*/
|
*/
|
||||||
fun addNiLocationMarkerItem(niLocation: NiLocation) {
|
fun addNiLocationMarkerItem(niLocation: NiLocation) {
|
||||||
synchronized(this) {
|
var geoMarkerItem = createNILocationBitmap(niLocation)
|
||||||
var geoMarkerItem = createNILocationBitmap(niLocation)
|
niLocationItemizedLayer.addItem(geoMarkerItem)
|
||||||
niLocationItemizedLayer.addItem(geoMarkerItem)
|
niLocationItemizedLayer.update()
|
||||||
niLocationItemizedLayer.update()
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* 添加质检数据marker
|
||||||
|
*/
|
||||||
|
fun addNiLocationMarkerItemSimple(niLocation: NiLocation) {
|
||||||
|
var geoMarkerItem = createNILocationBitmap(niLocation)
|
||||||
|
niLocationItemizedLayerSimple.addItem(geoMarkerItem)
|
||||||
|
niLocationItemizedLayerSimple.update()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createNILocationBitmap(niLocation: NiLocation): MarkerItem {
|
private fun createNILocationBitmap(niLocation: NiLocation): MarkerItem {
|
||||||
@ -791,6 +868,8 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
fun clearNiLocationLayer() {
|
fun clearNiLocationLayer() {
|
||||||
niLocationItemizedLayer.removeAllItems()
|
niLocationItemizedLayer.removeAllItems()
|
||||||
niLocationItemizedLayer.update()
|
niLocationItemizedLayer.update()
|
||||||
|
niLocationItemizedLayerSimple.removeAllItems()
|
||||||
|
niLocationItemizedLayerSimple.update()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -805,6 +884,18 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
return niLocationItemizedLayer.itemList.size
|
return niLocationItemizedLayer.itemList.size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getNILocationItemizedLayerSimpleSize(): Int {
|
||||||
|
return niLocationItemizedLayerSimple.itemList.size
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getNILocationSimple(index: Int): NiLocation? {
|
||||||
|
return if (index > -1 && index < getNILocationItemizedLayerSimpleSize()) {
|
||||||
|
((niLocationItemizedLayerSimple.itemList[index]) as MarkerItem).uid as NiLocation
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun getNILocation(index: Int): NiLocation? {
|
fun getNILocation(index: Int): NiLocation? {
|
||||||
return if (index > -1 && index < getNILocationItemizedLayerSize()) {
|
return if (index > -1 && index < getNILocationItemizedLayerSize()) {
|
||||||
((niLocationItemizedLayer.itemList[index]) as MarkerItem).uid as NiLocation
|
((niLocationItemizedLayer.itemList[index]) as MarkerItem).uid as NiLocation
|
||||||
@ -833,6 +924,27 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
|
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getNILocationSimpleIndex(niLocation: NiLocation): Int? {
|
||||||
|
|
||||||
|
var list = niLocationItemizedLayerSimple.itemList
|
||||||
|
|
||||||
|
if (niLocation != null && list.isNotEmpty()) {
|
||||||
|
|
||||||
|
var index = -1
|
||||||
|
|
||||||
|
list.forEach {
|
||||||
|
|
||||||
|
index += 1
|
||||||
|
|
||||||
|
if (((it as MarkerItem).uid as NiLocation).id.equals(niLocation.id)) {
|
||||||
|
return index
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface OnQsRecordItemClickListener : BaseClickListener {
|
interface OnQsRecordItemClickListener : BaseClickListener {
|
||||||
|
2
vtm
@ -1 +1 @@
|
|||||||
Subproject commit c046e788f5c739612a31c308639fca2de639669a
|
Subproject commit 9e0cc6dcdce04d1082ed6459e8810d6329e8cfdc
|