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,
|
||||
"zoomMax": 17
|
||||
},
|
||||
"2041": {
|
||||
"table": "OMDB_LANE_NUM",
|
||||
"code": 2041,
|
||||
"name": "车道数"
|
||||
},
|
||||
"2083": {
|
||||
"table": "OMDB_RDBOUND_BOUNDARYTYPE",
|
||||
"code": 2083,
|
||||
|
@ -40,6 +40,13 @@ class Constant {
|
||||
*/
|
||||
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 USER_DATA_LOG_PATH: String
|
||||
|
||||
/**
|
||||
* 图层管理对应的配置
|
||||
* */
|
||||
@ -107,6 +119,11 @@ class Constant {
|
||||
*/
|
||||
var MapMarkerCloseEnable = false
|
||||
|
||||
/**
|
||||
* 轨迹显隐
|
||||
*/
|
||||
var MapTraceCloseEnable = false
|
||||
|
||||
/**
|
||||
* 是否开启线捕捉
|
||||
*/
|
||||
|
@ -8,6 +8,7 @@ import android.view.Surface
|
||||
import android.view.WindowManager
|
||||
import com.navinfo.omqs.tools.FileManager
|
||||
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
||||
import com.navinfo.omqs.util.CMLog
|
||||
import com.navinfo.omqs.util.NetUtils
|
||||
import com.umeng.commonsdk.UMConfigure
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
@ -20,6 +21,7 @@ class OMQSApplication : Application() {
|
||||
super.onCreate()
|
||||
FileManager.initRootDir(this)
|
||||
Util.getInstance().init(applicationContext)
|
||||
CMLog.getInstance().init(applicationContext)
|
||||
NetUtils.getInstance().init(this)
|
||||
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.db.deep.LinkList
|
||||
import com.navinfo.omqs.hilt.OMDBDataBaseHiltFactory
|
||||
import com.navinfo.omqs.util.CMLog
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedInject
|
||||
import io.realm.Realm
|
||||
@ -324,31 +325,6 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
}
|
||||
|
||||
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) {
|
||||
when (value) {
|
||||
is String -> renderEntity.properties[key] = value
|
||||
@ -435,7 +411,6 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//遍历判断只显示与任务Link相关的任务数据
|
||||
@ -495,19 +470,6 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
|
||||
} else {
|
||||
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) {
|
||||
@ -718,6 +680,12 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
renderEntity.linkRelation!!.eNodeId =
|
||||
renderEntity.properties["enodePid"]
|
||||
}
|
||||
|
||||
//去掉暂用控件较大的字段多余属性字段
|
||||
if (renderEntity.properties.containsKey("shapeList")) {
|
||||
renderEntity.properties.remove("shapeList")
|
||||
}
|
||||
|
||||
renderEntity.propertiesDb = StrZipUtil.compress(
|
||||
gson.toJson(renderEntity.properties).toString()
|
||||
)
|
||||
|
@ -567,10 +567,12 @@ class ImportPreProcess {
|
||||
renderEntityTemp.catchEnable = renderEntity.catchEnable
|
||||
var dis = -lateralOffset.toDouble() / 100000000
|
||||
//最小值取10厘米,否正渲染太近无法显示
|
||||
if (dis > 0 && dis < 0.0000028) {
|
||||
dis = 0.0000028
|
||||
} else if (dis > -0.0000028 && dis < 0) {
|
||||
dis = -0.0000028
|
||||
if (dis > 0 && dis < 0.000005) {
|
||||
dis = 0.000005
|
||||
Log.d("lateralOffset", "$dis")
|
||||
} else if (dis > -0.000005 && dis < 0) {
|
||||
dis = -0.000005
|
||||
Log.d("lateralOffset", "$dis")
|
||||
}
|
||||
renderEntityTemp.geometry = GeometryTools.computeLine(
|
||||
dis,
|
||||
@ -739,10 +741,11 @@ class ImportPreProcess {
|
||||
// angleReference.renderEntityId = renderEntity.id
|
||||
angleReference.name = "${renderEntity.name}车道中线面"
|
||||
angleReference.table = renderEntity.table
|
||||
Log.e("jingo", "几何转换开始")
|
||||
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)
|
||||
|
||||
Log.e("jingo", "几何转换结束")
|
||||
angleReference.properties["qi_table"] = renderEntity.table
|
||||
angleReference.properties["widthProperties"] = "3"
|
||||
angleReference.zoomMin = renderEntity.zoomMin
|
||||
|
@ -287,6 +287,12 @@ class LoginViewModel @Inject constructor(
|
||||
task.fileSize = item.fileSize
|
||||
task.status = item.status
|
||||
task.currentSize = item.currentSize
|
||||
//增加mesh==null兼容性处理
|
||||
for (hadLink in item.hadLinkDvoList) {
|
||||
if(hadLink.mesh==null){
|
||||
hadLink.mesh = ""
|
||||
}
|
||||
}
|
||||
task.hadLinkDvoList = item.hadLinkDvoList
|
||||
task.syncStatus = item.syncStatus
|
||||
//已上传后不在更新操作时间
|
||||
@ -298,8 +304,10 @@ class LoginViewModel @Inject constructor(
|
||||
}
|
||||
} else {
|
||||
for (hadLink in task.hadLinkDvoList) {
|
||||
if(hadLink.geometry==null||hadLink.mesh==null){
|
||||
if(hadLink.geometry==null){
|
||||
inSertData = false
|
||||
}else if(hadLink.mesh==null){
|
||||
hadLink.mesh = ""
|
||||
}else{
|
||||
hadLink.taskId = task.id
|
||||
}
|
||||
@ -423,12 +431,15 @@ class LoginViewModel @Inject constructor(
|
||||
Constant.VERSION_ID = userId
|
||||
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_LOG_PATH = Constant.USER_DATA_PATH + "/log/"
|
||||
// 在SD卡创建用户目录,解压资源等
|
||||
val userFolder = File(Constant.USER_DATA_PATH)
|
||||
if (!userFolder.exists()) userFolder.mkdirs()
|
||||
//创建附件目录
|
||||
val userAttachmentFolder = File(Constant.USER_DATA_ATTACHEMNT_PATH)
|
||||
if (!userAttachmentFolder.exists()) userAttachmentFolder.mkdirs()
|
||||
val userLogFolder = File(Constant.USER_DATA_LOG_PATH)
|
||||
if (!userLogFolder.exists()) userLogFolder.mkdirs()
|
||||
// 初始化Realm
|
||||
Realm.init(context.applicationContext)
|
||||
// 656e6372797000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
|
@ -344,7 +344,7 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
viewModel.liveDataAutoLocation.observe(this) {
|
||||
if (it == true) {
|
||||
if (it == true&&Constant.INDOOR_IP==null|| Constant.INDOOR_IP == "") {
|
||||
onClickLocation()
|
||||
}
|
||||
}
|
||||
@ -844,6 +844,7 @@ class MainActivity : BaseActivity() {
|
||||
*/
|
||||
fun setTopMenuButtonVisibility(visibility: Int) {
|
||||
binding.mainActivityMenu.visibility = visibility
|
||||
binding.mainActivityStatusCamera.visibility = visibility
|
||||
if (visibility != View.VISIBLE) {
|
||||
binding.mainActivityMenuGroup.visibility = View.INVISIBLE
|
||||
binding.mainActivityMenu.isSelected = false
|
||||
|
@ -23,6 +23,7 @@ import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import androidx.navigation.findNavController
|
||||
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.entity.*
|
||||
import com.navinfo.collect.library.enums.DataCodeEnum
|
||||
@ -250,6 +251,8 @@ class MainViewModel @Inject constructor(
|
||||
private val naviMutex = Mutex()
|
||||
private var testRealm: Realm? = null;
|
||||
|
||||
private var traceCount = 0
|
||||
|
||||
init {
|
||||
mapController.mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
||||
when (e) {
|
||||
@ -563,7 +566,14 @@ class MainViewModel @Inject constructor(
|
||||
).niLocationDao.findToTaskIdAll(id.toString())
|
||||
if (list != null) {
|
||||
for (location in list) {
|
||||
Constant.TRACE_COUNT++
|
||||
|
||||
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() {
|
||||
var gson = Gson();
|
||||
|
||||
//用于定位点存储到数据库
|
||||
viewModelScope.launch(Dispatchers.Default) {
|
||||
@ -627,10 +638,18 @@ class MainViewModel @Inject constructor(
|
||||
}
|
||||
//室内整理工具时不能进行轨迹存储,判断轨迹间隔要超过2.5并小于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)
|
||||
mapController.markerHandle.addNiLocationMarkerItem(location)
|
||||
if(Constant.TRACE_COUNT%Constant.TRACE_COUNT_TIME==0){
|
||||
mapController.markerHandle.addNiLocationMarkerItemSimple(location)
|
||||
}
|
||||
mapController.mMapView.vtmMap.updateMap(true)
|
||||
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() {
|
||||
val mapPosition: MapPosition = mapController.mMapView.vtmMap.getMapPosition()
|
||||
mapPosition.setBearing(0f) // 锁定角度,自动将地图旋转到正北方向
|
||||
mapController.mMapView.vtmMap.setMapPosition(mapPosition)
|
||||
mapController.mMapView.vtmMap.mapPosition = mapPosition
|
||||
mapController.locationLayerHandler.animateToCurrentPosition()
|
||||
naviEngineStatus = 1
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ class SignAdapter(private var listener: OnSignAdapterClickListener?) :
|
||||
override fun getItemViewType(position: Int): Int {
|
||||
if (data.isNotEmpty() && data[position].renderEntity.code == DataCodeEnum.OMDB_LANEINFO.code) {
|
||||
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) {
|
||||
return 4023
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
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.callback.FSAFActivityCallbacks
|
||||
import com.github.k1rakishou.fsaf.callback.FileChooserCallback
|
||||
import com.google.android.material.internal.NavigationMenuItemView
|
||||
import com.google.android.material.timepicker.MaterialTimePicker
|
||||
import com.navinfo.collect.library.enums.DataLayerEnum
|
||||
import com.navinfo.collect.library.map.NIMapController
|
||||
@ -40,6 +42,7 @@ import com.permissionx.guolindev.PermissionX
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import org.oscim.core.GeoPoint
|
||||
import org.oscim.core.MapPosition
|
||||
import org.oscim.utils.MinHeap.Item
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
@ -73,7 +76,7 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
binding.root.setNavigationItemSelectedListener {
|
||||
binding.root.setNavigationItemSelectedListener { it ->
|
||||
when (it.itemId) {
|
||||
R.id.personal_center_menu_offline_map ->
|
||||
findNavController().navigate(R.id.OfflineMapFragment)
|
||||
@ -151,7 +154,7 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
||||
val mapPosition: MapPosition =
|
||||
niMapController.mMapView.vtmMap.getMapPosition()
|
||||
mapPosition.setBearing(0f) // 锁定角度,自动将地图旋转到正北方向
|
||||
niMapController.mMapView.vtmMap.setMapPosition(mapPosition)
|
||||
niMapController.mMapView.vtmMap.mapPosition = mapPosition
|
||||
it.title = "开启地图旋转及视角"
|
||||
} else {
|
||||
it.title = "锁定地图旋转及视角"
|
||||
@ -168,6 +171,17 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
||||
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 -> {
|
||||
Constant.CATCH_ALL = !Constant.CATCH_ALL
|
||||
if (Constant.CATCH_ALL) {
|
||||
@ -258,6 +272,13 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
||||
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.addTaskLink(requireContext(),it)
|
||||
}
|
||||
viewModel.liveDataUpdateTask.observe(viewLifecycleOwner) {
|
||||
|
||||
}
|
||||
|
||||
//注意:使用滑动菜单不能开启滑动删除,否则只有滑动删除没有滑动菜单
|
||||
val mSwipeMenuCreator = SwipeMenuCreator { _, rightMenu, _ ->
|
||||
|
@ -89,8 +89,15 @@ class TaskListFragment : BaseFragment() {
|
||||
deleteItem.background = requireContext().getDrawable(R.color.red)
|
||||
deleteItem.setTextColor(requireContext().resources.getColor(R.color.white))
|
||||
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)
|
||||
//// 设置 RecyclerView 的固定大小,避免在滚动时重新计算视图大小和布局,提高性能
|
||||
@ -104,11 +111,15 @@ class TaskListFragment : BaseFragment() {
|
||||
binding.taskListRecyclerview.setOnItemMenuClickListener { menuBridge, position ->
|
||||
menuBridge.closeMenu()
|
||||
val taskBean = adapter.data[position]
|
||||
if (taskBean.syncStatus != FileManager.Companion.FileUploadStatus.DONE) {
|
||||
Toast.makeText(context, "数据未上传,不允许关闭!", Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
} else {
|
||||
viewModel.removeTask(requireContext(), taskBean)
|
||||
if(menuBridge.position==0){
|
||||
if (taskBean.syncStatus != FileManager.Companion.FileUploadStatus.DONE) {
|
||||
Toast.makeText(context, "数据未上传,不允许关闭!", Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
} else {
|
||||
viewModel.removeTask(requireContext(), taskBean)
|
||||
}
|
||||
}else{
|
||||
viewModel.resetDownload(requireContext(), taskBean)
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,6 +145,28 @@ class TaskListFragment : BaseFragment() {
|
||||
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) {
|
||||
for ((key, value) in it) {
|
||||
|
@ -4,6 +4,7 @@ import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.annotation.RequiresApi
|
||||
@ -31,6 +32,32 @@ import org.oscim.core.GeoPoint
|
||||
import java.io.File
|
||||
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
|
||||
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 {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val realm = realmOperateHelper.getSelectTaskRealmInstance()
|
||||
val links = realmOperateHelper.queryLink(realm,
|
||||
val links = realmOperateHelper.queryLink(
|
||||
realm,
|
||||
point = point,
|
||||
)
|
||||
if (links.isNotEmpty()) {
|
||||
@ -179,6 +212,13 @@ class TaskViewModel @Inject constructor(
|
||||
task.fileSize = item.fileSize
|
||||
task.status = item.status
|
||||
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.syncStatus = item.syncStatus
|
||||
//已上传后不在更新操作时间
|
||||
@ -191,11 +231,16 @@ class TaskViewModel @Inject constructor(
|
||||
} else {
|
||||
for (hadLink in task.hadLinkDvoList) {
|
||||
hadLink.taskId = task.id
|
||||
if (hadLink.mesh == null) {
|
||||
hadLink.mesh = ""
|
||||
Log.e("qj", "${task.id}==新增==null")
|
||||
}
|
||||
}
|
||||
//赋值时间,用于查询过滤
|
||||
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
|
||||
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)
|
||||
Constant.currentSelectTaskFolder = File(Constant.USER_DATA_PATH + "/${taskBean.id}")
|
||||
Constant.currentSelectTaskConfig =
|
||||
RealmConfiguration.Builder()
|
||||
.directory(Constant.currentSelectTaskFolder)
|
||||
.name("OMQS.realm")
|
||||
.encryptionKey(Constant.PASSWORD)
|
||||
// .assetFile("${Constant.currentSelectTaskFolder}/OMQS.realm")
|
||||
// .readOnly()
|
||||
//.allowQueriesOnUiThread(true)
|
||||
RealmConfiguration.Builder().directory(Constant.currentSelectTaskFolder)
|
||||
.name("OMQS.realm").encryptionKey(Constant.PASSWORD).allowQueriesOnUiThread(true)
|
||||
.schemaVersion(2).build()
|
||||
MapParamUtils.setTaskConfig(Constant.currentSelectTaskConfig)
|
||||
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.dismiss()
|
||||
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_BEGIN)
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_LOADING)
|
||||
val realm = realmOperateHelper.getRealmDefaultInstance()
|
||||
realm.executeTransaction {
|
||||
val objects =
|
||||
@ -461,14 +585,14 @@ class TaskViewModel @Inject constructor(
|
||||
FileManager.checkOMDBFileInfo(item)
|
||||
}
|
||||
liveDataTaskList.postValue(taskList)
|
||||
liveDataCloseTask.postValue(true)
|
||||
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_SUCCESS)
|
||||
realm.close()
|
||||
}
|
||||
}
|
||||
mDialog.setNegativeButton(
|
||||
"取消"
|
||||
) { _, _ ->
|
||||
liveDataCloseTask.postValue(false)
|
||||
liveDataCloseTask.postValue(TaskDelStatus.TASK_DEL_STATUS_CANCEL)
|
||||
mDialog.dismiss()
|
||||
}
|
||||
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_RESTRICTION.name,
|
||||
DataCodeEnum.OMDB_LANEINFO.name,
|
||||
DataCodeEnum.OMDB_CLM_LANEINFO.name,
|
||||
DataCodeEnum.OMDB_TRAFFIC_SIGN.name,
|
||||
DataCodeEnum.OMDB_WARNINGSIGN.name,
|
||||
DataCodeEnum.OMDB_TOLLGATE.name
|
||||
|
@ -107,7 +107,7 @@ class SignUtil {
|
||||
//物理车道数OMDB_PHY_LANENUM
|
||||
DataCodeEnum.OMDB_LANE_NUM.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_LANE_NUM.code -> {
|
||||
list.add(
|
||||
/* list.add(
|
||||
TwoItemAdapterItem(
|
||||
title = "车道总数", text = "${data.properties["laneNum"]}"
|
||||
)
|
||||
)
|
||||
)*/
|
||||
list.add(
|
||||
TwoItemAdapterItem(
|
||||
title = "顺方向车道数", text = "${data.properties["laneS2e"]}"
|
||||
@ -1426,14 +1426,14 @@ class SignUtil {
|
||||
)
|
||||
DataCodeEnum.OMDB_RD_LINK_KIND.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(
|
||||
"${
|
||||
item.iconText.substringBefore(
|
||||
"|"
|
||||
)
|
||||
}车道"
|
||||
)
|
||||
)*/
|
||||
}
|
||||
}
|
||||
return stringBuffer.toString()
|
||||
|
@ -48,12 +48,17 @@
|
||||
android:title="锁定地图旋转及视角" />
|
||||
<item
|
||||
android:id="@+id/personal_center_menu_marker"
|
||||
android:icon="@drawable/baseline_person_24"
|
||||
android:icon="@drawable/baseline_map_24"
|
||||
android:visible="true"
|
||||
android:title="隐藏Marker" />
|
||||
<item
|
||||
android:id="@+id/personal_center_menu_trace"
|
||||
android:icon="@drawable/baseline_map_24"
|
||||
android:visible="true"
|
||||
android:title="隐藏轨迹" />
|
||||
<item
|
||||
android:id="@+id/personal_center_menu_catch_all"
|
||||
android:icon="@drawable/baseline_person_24"
|
||||
android:icon="@drawable/baseline_map_24"
|
||||
android:visible="true"
|
||||
android:title="全要素捕捉" />
|
||||
<item
|
||||
|
@ -1558,7 +1558,11 @@
|
||||
<symbol repeat="false" repeat-start="0" repeat-gap="2000"
|
||||
src="@symbol" symbol-height="24" degree="90"></symbol>
|
||||
</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">
|
||||
<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="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 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 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 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 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>
|
||||
|
@ -1,11 +1,10 @@
|
||||
<?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>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="136.1" height="113.4"
|
||||
viewBox="0 0 136.1 113.4">
|
||||
<g id="c">
|
||||
<g>
|
||||
<rect width="136.1" height="113.4" style="fill:none;" />
|
||||
<polygon points="109.7 56.7 0 56.7 26.4 0 136.1 0 109.7 56.7" style="fill:#8e44ad;" />
|
||||
</g>
|
||||
</g>
|
||||
</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"
|
||||
"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>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="136.1" height="113.4"
|
||||
viewBox="0 0 136.1 113.4">
|
||||
<g id="c">
|
||||
<g>
|
||||
<rect width="136.1" height="113.4" style="fill:none;" />
|
||||
<polygon points="109.7 56.7 0 56.7 26.4 0 136.1 0 109.7 56.7" style="fill:#fff;" />
|
||||
</g>
|
||||
</g>
|
||||
</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"
|
||||
"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>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="136.1" height="113.4"
|
||||
viewBox="0 0 136.1 113.4">
|
||||
<g id="c">
|
||||
<g>
|
||||
<rect width="136.1" height="113.4" style="fill:none;" />
|
||||
<polygon points="109.7 56.7 0 56.7 26.4 0 136.1 0 109.7 56.7" style="fill:#eccc68;" />
|
||||
</g>
|
||||
</g>
|
||||
</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"
|
||||
"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>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="136.1" height="113.4"
|
||||
viewBox="0 0 136.1 113.4">
|
||||
<g id="c">
|
||||
<g>
|
||||
<rect width="136.1" height="113.4" style="fill:none;" />
|
||||
<polygon points="109.7 56.7 0 56.7 26.4 0 136.1 0 109.7 56.7" style="fill:#0000ff;" />
|
||||
</g>
|
||||
</g>
|
||||
</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"
|
||||
"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>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="b" xmlns="http://www.w3.org/2000/svg" width="136.1" height="113.4"
|
||||
viewBox="0 0 136.1 113.4">
|
||||
<g id="c">
|
||||
<g>
|
||||
<rect width="136.1" height="113.4" style="fill:none;" />
|
||||
<polygon points="109.7 56.7 0 56.7 26.4 0 136.1 0 109.7 56.7" style="fill:#00ff00;" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 730 B After Width: | Height: | Size: 369 B |
@ -1,5 +1,7 @@
|
||||
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.annotations.PrimaryKey
|
||||
|
||||
@ -12,11 +14,13 @@ open class HadLinkDvoBean @JvmOverloads constructor(
|
||||
* 图幅号
|
||||
*/
|
||||
var mesh: String = "",
|
||||
|
||||
/**
|
||||
* linkPid
|
||||
*/
|
||||
@PrimaryKey
|
||||
var linkPid: String = "",
|
||||
|
||||
/**
|
||||
* (几何)加偏后
|
||||
*/
|
||||
@ -31,10 +35,12 @@ open class HadLinkDvoBean @JvmOverloads constructor(
|
||||
* 1:源库link,2:选择link 3:现场新增
|
||||
*/
|
||||
var linkStatus: Int = 1,
|
||||
|
||||
/**
|
||||
* 详细属性
|
||||
*/
|
||||
var linkInfo: LinkInfoBean? = null,
|
||||
|
||||
/**
|
||||
* 长度(米)
|
||||
*/
|
||||
|
@ -81,6 +81,7 @@ enum class DataCodeEnum(var tableName: String, var code: String) {
|
||||
OMDB_TRAFFICLIGHT("交通灯", "4022"),
|
||||
OMDB_TOLLGATE("收费站", "4023"),
|
||||
OMDB_LANEINFO("车信", "4601"),
|
||||
OMDB_CLM_LANEINFO("车信CLM", "4602"),
|
||||
OMDB_LANE_LINK_LG("车道中心线", "5001");
|
||||
|
||||
companion object {
|
||||
|
@ -608,6 +608,7 @@ public final class NIMapView extends RelativeLayout {
|
||||
LABEL(4)/*图标,文字图层*/,
|
||||
OPERATE_LINE(5)/*操作图层组*/,
|
||||
OPERATE_MARKER(6)/*操作图层组*/;
|
||||
|
||||
int groupIndex;
|
||||
|
||||
LAYER_GROUPS(int groupIndex) {
|
||||
|
@ -171,7 +171,7 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
mCurrentLocation?.run {
|
||||
val mapPosition = mMapView.vtmMap.mapPosition
|
||||
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.layers.marker.*
|
||||
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.map.Map
|
||||
import java.util.*
|
||||
@ -43,8 +45,17 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
*/
|
||||
private val mDefaultTextColor = "#4E55AF"
|
||||
|
||||
/**
|
||||
* 默认Marker可用状态
|
||||
*/
|
||||
private var markerEnable = true
|
||||
|
||||
/**
|
||||
* 默认轨迹可用状态
|
||||
*/
|
||||
private var traceMarkerEnable = true
|
||||
|
||||
|
||||
/**
|
||||
* 文字画笔
|
||||
*/
|
||||
@ -179,6 +190,45 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
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 图层
|
||||
*/
|
||||
@ -213,7 +263,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
layer.isEnabled = false
|
||||
addLayer(layer, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
|
||||
layer
|
||||
}
|
||||
@ -277,13 +327,18 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
// 设置矢量图层均在12级以上才显示
|
||||
mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
||||
if (e == Map.SCALE_EVENT) {
|
||||
if(markerEnable){
|
||||
if (markerEnable) {
|
||||
qsRecordItemizedLayer.isEnabled = mapPosition.getZoomLevel() >= 12
|
||||
}else{
|
||||
} else {
|
||||
qsRecordItemizedLayer.isEnabled = false
|
||||
}
|
||||
|
||||
niLocationItemizedLayer.isEnabled = mapPosition.getZoomLevel() >= 12
|
||||
if (traceMarkerEnable) {
|
||||
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)
|
||||
}
|
||||
|
||||
fun setQsRecordMarkEnable(enable:Boolean){
|
||||
/**
|
||||
* Marker是否显示
|
||||
*/
|
||||
fun setQsRecordMarkEnable(enable: Boolean) {
|
||||
qsRecordItemizedLayer.isEnabled = enable
|
||||
markerEnable = enable
|
||||
qsRecordItemizedLayer.populate()
|
||||
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
|
||||
*/
|
||||
fun addNiLocationMarkerItem(niLocation: NiLocation) {
|
||||
synchronized(this) {
|
||||
var geoMarkerItem = createNILocationBitmap(niLocation)
|
||||
niLocationItemizedLayer.addItem(geoMarkerItem)
|
||||
niLocationItemizedLayer.update()
|
||||
}
|
||||
var geoMarkerItem = createNILocationBitmap(niLocation)
|
||||
niLocationItemizedLayer.addItem(geoMarkerItem)
|
||||
niLocationItemizedLayer.update()
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加质检数据marker
|
||||
*/
|
||||
fun addNiLocationMarkerItemSimple(niLocation: NiLocation) {
|
||||
var geoMarkerItem = createNILocationBitmap(niLocation)
|
||||
niLocationItemizedLayerSimple.addItem(geoMarkerItem)
|
||||
niLocationItemizedLayerSimple.update()
|
||||
}
|
||||
|
||||
private fun createNILocationBitmap(niLocation: NiLocation): MarkerItem {
|
||||
@ -791,6 +868,8 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
fun clearNiLocationLayer() {
|
||||
niLocationItemizedLayer.removeAllItems()
|
||||
niLocationItemizedLayer.update()
|
||||
niLocationItemizedLayerSimple.removeAllItems()
|
||||
niLocationItemizedLayerSimple.update()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -805,6 +884,18 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
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? {
|
||||
return if (index > -1 && index < getNILocationItemizedLayerSize()) {
|
||||
((niLocationItemizedLayer.itemList[index]) as MarkerItem).uid as NiLocation
|
||||
@ -833,6 +924,27 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
|
||||
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 {
|
||||
|
2
vtm
@ -1 +1 @@
|
||||
Subproject commit c046e788f5c739612a31c308639fca2de639669a
|
||||
Subproject commit 9e0cc6dcdce04d1082ed6459e8810d6329e8cfdc
|