增加室内整理工具反向控制
This commit is contained in:
parent
063927653a
commit
45de9982fc
@ -185,6 +185,7 @@ class MainActivity : BaseActivity() {
|
|||||||
MotionEvent.ACTION_DOWN -> {
|
MotionEvent.ACTION_DOWN -> {
|
||||||
voiceOnTouchStart()//Do Something
|
voiceOnTouchStart()//Do Something
|
||||||
}
|
}
|
||||||
|
|
||||||
MotionEvent.ACTION_UP -> {
|
MotionEvent.ACTION_UP -> {
|
||||||
voiceOnTouchStop()//Do Something
|
voiceOnTouchStop()//Do Something
|
||||||
}
|
}
|
||||||
@ -235,13 +236,18 @@ class MainActivity : BaseActivity() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
//捕捉列表变化回调
|
//捕捉轨迹点
|
||||||
viewModel.liveDataNILocationList.observe(this) {
|
viewModel.liveDataNILocationList.observe(this) {
|
||||||
if(viewModel.isSelectTrace()){
|
if (viewModel.isSelectTrace()) {
|
||||||
//Toast.makeText(this,"轨迹被点击了",Toast.LENGTH_LONG).show()
|
//Toast.makeText(this,"轨迹被点击了",Toast.LENGTH_LONG).show()
|
||||||
viewModel.showMarker(this,it)
|
viewModel.showMarker(this, it)
|
||||||
val traceVideoBean = TraceVideoBean(command = "videotime?", userid = Constant.USER_ID, time = "${it.time}:000")
|
viewModel.setCurrentIndexNiLocation(it)
|
||||||
viewModel.sendServerCommand(this,traceVideoBean)
|
val traceVideoBean = TraceVideoBean(
|
||||||
|
command = "videotime?",
|
||||||
|
userid = Constant.USER_ID,
|
||||||
|
time = "${it.time}:000"
|
||||||
|
)
|
||||||
|
viewModel.sendServerCommand(this, traceVideoBean,IndoorToolsCommand.SELECT_POINT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,6 +327,49 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewModel.liveIndoorToolsResp.observe(this){
|
||||||
|
when(it){
|
||||||
|
IndoorToolsResp.QR_CODE_STATUS_UPDATE_VIDEO_INFO_SUCCESS->{
|
||||||
|
|
||||||
|
if(viewModel.indoorToolsCommand==IndoorToolsCommand.SELECT_POINT){
|
||||||
|
selectPointFinish(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
IndoorToolsResp.QR_CODE_STATUS_UPDATE_VIDEO_INFO_FAILURE->{
|
||||||
|
if(viewModel.indoorToolsCommand==IndoorToolsCommand.SELECT_POINT){
|
||||||
|
selectPointFinish(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//室内整理工具反向控制
|
||||||
|
viewModel.liveIndoorToolsCommand.observe(this) {
|
||||||
|
when (it) {
|
||||||
|
IndoorToolsCommand.PLAY -> {
|
||||||
|
setPlayStatus()
|
||||||
|
}
|
||||||
|
IndoorToolsCommand.INDEXING -> {
|
||||||
|
pausePlayTrace()
|
||||||
|
}
|
||||||
|
IndoorToolsCommand.SELECT_POINT -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
IndoorToolsCommand.NEXT -> {
|
||||||
|
}
|
||||||
|
|
||||||
|
IndoorToolsCommand.REWIND -> {
|
||||||
|
}
|
||||||
|
|
||||||
|
IndoorToolsCommand.STOP -> {
|
||||||
|
//切换为暂停状态
|
||||||
|
pausePlayTrace()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
// 初始化地图图层控制接收器
|
// 初始化地图图层控制接收器
|
||||||
FlowEventBus.subscribe<List<ImportConfig>>(
|
FlowEventBus.subscribe<List<ImportConfig>>(
|
||||||
@ -551,13 +600,10 @@ class MainActivity : BaseActivity() {
|
|||||||
viewModel.setSelectTrace(!viewModel.isSelectTrace())
|
viewModel.setSelectTrace(!viewModel.isSelectTrace())
|
||||||
binding.mainActivityTraceSnapshotPoints.isSelected = viewModel.isSelectTrace()
|
binding.mainActivityTraceSnapshotPoints.isSelected = viewModel.isSelectTrace()
|
||||||
|
|
||||||
if(viewModel.isSelectTrace()){
|
if (viewModel.isSelectTrace()) {
|
||||||
Toast.makeText(this,"请选择轨迹点!",Toast.LENGTH_LONG).show()
|
Toast.makeText(this, "请选择轨迹点!", Toast.LENGTH_LONG).show()
|
||||||
//调用撤销自动播放
|
//调用撤销自动播放
|
||||||
binding.mainActivitySnapshotFinish.isEnabled = false
|
setViewEnable(false)
|
||||||
binding.mainActivitySnapshotRewind.isEnabled = false
|
|
||||||
binding.mainActivitySnapshotPause.isEnabled = false
|
|
||||||
binding.mainActivitySnapshotNext.isEnabled = false
|
|
||||||
viewModel.cancelTrace()
|
viewModel.cancelTrace()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -592,13 +638,17 @@ class MainActivity : BaseActivity() {
|
|||||||
@RequiresApi(Build.VERSION_CODES.N)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
fun rewindTraceOnclick() {
|
fun rewindTraceOnclick() {
|
||||||
pausePlayTrace()
|
pausePlayTrace()
|
||||||
val item = mapController.markerHandle.getNILocation(viewModel.currentIndexNiLocation-1)
|
val item = mapController.markerHandle.getNILocation(viewModel.getCurrentNiLocationIndex() - 1)
|
||||||
if(item!=null){
|
if (item != null) {
|
||||||
viewModel.currentIndexNiLocation = viewModel.currentIndexNiLocation-1
|
viewModel.setCurrentIndexLoction(viewModel.getCurrentNiLocationIndex() - 1)
|
||||||
viewModel.showMarker(this,(item as MarkerItem).uid as NiLocation)
|
viewModel.showMarker(this, (item as MarkerItem).uid as NiLocation)
|
||||||
val traceVideoBean = TraceVideoBean(command = "videotime?", userid = Constant.USER_ID, time = "${(item.uid as NiLocation).time}:000")
|
val traceVideoBean = TraceVideoBean(
|
||||||
viewModel.sendServerCommand(this,traceVideoBean)
|
command = "videotime?",
|
||||||
}else{
|
userid = Constant.USER_ID,
|
||||||
|
time = "${(item.uid as NiLocation).time}:000"
|
||||||
|
)
|
||||||
|
viewModel.sendServerCommand(this, traceVideoBean,IndoorToolsCommand.REWIND)
|
||||||
|
} else {
|
||||||
dealNoData()
|
dealNoData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -612,24 +662,24 @@ class MainActivity : BaseActivity() {
|
|||||||
binding.mainActivitySnapshotPause.isSelected = viewModel.isSelectPauseTrace()
|
binding.mainActivitySnapshotPause.isSelected = viewModel.isSelectPauseTrace()
|
||||||
viewModel.setSelectTrace(false)
|
viewModel.setSelectTrace(false)
|
||||||
binding.mainActivityTraceSnapshotPoints.isSelected = viewModel.isSelectTrace()
|
binding.mainActivityTraceSnapshotPoints.isSelected = viewModel.isSelectTrace()
|
||||||
if(viewModel.isSelectPauseTrace()){
|
if (viewModel.isSelectPauseTrace()) {
|
||||||
playVideo()
|
playVideo()
|
||||||
}else{
|
} else {
|
||||||
pauseVideo()
|
pauseVideo()
|
||||||
viewModel.cancelTrace()
|
viewModel.cancelTrace()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.N)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
fun playVideo(){
|
fun playVideo() {
|
||||||
if (mapController.markerHandle.getCurrentMark()==null) {
|
if (mapController.markerHandle.getCurrentMark() == null) {
|
||||||
BaseToast.makeText(this, "请先选择轨迹点!", BaseToast.LENGTH_SHORT).show()
|
BaseToast.makeText(this, "请先选择轨迹点!", BaseToast.LENGTH_SHORT).show()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
viewModel.setSelectTrace(false)
|
viewModel.setSelectTrace(false)
|
||||||
binding.mainActivityTraceSnapshotPoints.isSelected = viewModel.isSelectTrace()
|
binding.mainActivityTraceSnapshotPoints.isSelected = viewModel.isSelectTrace()
|
||||||
val traceVideoBean = TraceVideoBean(command = "playVideo?", userid = Constant.USER_ID)
|
val traceVideoBean = TraceVideoBean(command = "playVideo?", userid = Constant.USER_ID)
|
||||||
viewModel.sendServerCommand(this,traceVideoBean)
|
viewModel.sendServerCommand(this, traceVideoBean,IndoorToolsCommand.PLAY)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -644,9 +694,9 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.N)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
fun pauseVideo(){
|
fun pauseVideo() {
|
||||||
val traceVideoBean = TraceVideoBean(command = "pauseVideo?", userid = Constant.USER_ID)
|
val traceVideoBean = TraceVideoBean(command = "pauseVideo?", userid = Constant.USER_ID)
|
||||||
viewModel.sendServerCommand(this,traceVideoBean)
|
viewModel.sendServerCommand(this, traceVideoBean,IndoorToolsCommand.STOP)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -655,13 +705,17 @@ class MainActivity : BaseActivity() {
|
|||||||
@RequiresApi(Build.VERSION_CODES.N)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
fun nextTraceOnclick() {
|
fun nextTraceOnclick() {
|
||||||
pausePlayTrace()
|
pausePlayTrace()
|
||||||
val item = mapController.markerHandle.getNILocation(viewModel.currentIndexNiLocation+1)
|
val item = mapController.markerHandle.getNILocation(viewModel.getCurrentNiLocationIndex() + 1)
|
||||||
if(item!=null){
|
if (item != null) {
|
||||||
viewModel.currentIndexNiLocation = viewModel.currentIndexNiLocation+1
|
viewModel.setCurrentIndexLoction(viewModel.getCurrentNiLocationIndex()+1)
|
||||||
viewModel.showMarker(this,(item as MarkerItem).uid as NiLocation)
|
viewModel.showMarker(this, (item as MarkerItem).uid as NiLocation)
|
||||||
val traceVideoBean = TraceVideoBean(command = "videotime?", userid = Constant.USER_ID, time = "${(item.uid as NiLocation).time}:000")
|
val traceVideoBean = TraceVideoBean(
|
||||||
viewModel.sendServerCommand(this,traceVideoBean)
|
command = "videotime?",
|
||||||
}else{
|
userid = Constant.USER_ID,
|
||||||
|
time = "${(item.uid as NiLocation).time}:000"
|
||||||
|
)
|
||||||
|
viewModel.sendServerCommand(this, traceVideoBean,IndoorToolsCommand.NEXT)
|
||||||
|
} else {
|
||||||
dealNoData()
|
dealNoData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -688,6 +742,26 @@ class MainActivity : BaseActivity() {
|
|||||||
viewModel.cancelTrace()
|
viewModel.cancelTrace()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选点结束
|
||||||
|
* @param value true 选点成功 false 选点失败
|
||||||
|
*/
|
||||||
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
|
private fun selectPointFinish(value: Boolean) {
|
||||||
|
if (value) {
|
||||||
|
setViewEnable(true)
|
||||||
|
viewModel.setSelectPauseTrace(false)
|
||||||
|
binding.mainActivitySnapshotPause.isSelected = viewModel.isSelectPauseTrace()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setViewEnable(value: Boolean){
|
||||||
|
binding.mainActivitySnapshotRewind.isEnabled = value
|
||||||
|
binding.mainActivitySnapshotNext.isEnabled = value
|
||||||
|
binding.mainActivitySnapshotPause.isEnabled = value
|
||||||
|
binding.mainActivitySnapshotFinish.isEnabled = value
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打开或关闭底部导航栏
|
* 打开或关闭底部导航栏
|
||||||
@ -708,7 +782,12 @@ class MainActivity : BaseActivity() {
|
|||||||
mapController.mMapView.setScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 128, 65)
|
mapController.mMapView.setScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 128, 65)
|
||||||
}
|
}
|
||||||
mapController.mMapView.vtmMap.animator()
|
mapController.mMapView.vtmMap.animator()
|
||||||
.animateTo(GeoPoint( mapController.mMapView.vtmMap.mapPosition.geoPoint.latitude,mapController.mMapView.vtmMap.mapPosition.geoPoint.longitude))
|
.animateTo(
|
||||||
|
GeoPoint(
|
||||||
|
mapController.mMapView.vtmMap.mapPosition.geoPoint.latitude,
|
||||||
|
mapController.mMapView.vtmMap.mapPosition.geoPoint.longitude
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.N)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
@ -769,14 +848,14 @@ class MainActivity : BaseActivity() {
|
|||||||
*/
|
*/
|
||||||
fun showIndoorDataLayout() {
|
fun showIndoorDataLayout() {
|
||||||
binding.mainActivityMenuIndoorGroup.visibility = View.VISIBLE
|
binding.mainActivityMenuIndoorGroup.visibility = View.VISIBLE
|
||||||
if(Constant.INDOOR_IP.isNotEmpty()){
|
if (Constant.INDOOR_IP.isNotEmpty()) {
|
||||||
setIndoorGroupEnable(true)
|
setIndoorGroupEnable(true)
|
||||||
}else{
|
} else {
|
||||||
setIndoorGroupEnable(false)
|
setIndoorGroupEnable(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setIndoorGroupEnable(enable: Boolean){
|
private fun setIndoorGroupEnable(enable: Boolean) {
|
||||||
binding.mainActivitySnapshotFinish.isEnabled = enable
|
binding.mainActivitySnapshotFinish.isEnabled = enable
|
||||||
binding.mainActivityTraceSnapshotPoints.isEnabled = enable
|
binding.mainActivityTraceSnapshotPoints.isEnabled = enable
|
||||||
binding.mainActivitySnapshotMediaFlag.isEnabled = enable
|
binding.mainActivitySnapshotMediaFlag.isEnabled = enable
|
||||||
|
@ -43,6 +43,7 @@ import com.navinfo.omqs.ui.manager.TakePhotoManager
|
|||||||
import com.navinfo.omqs.ui.other.BaseToast
|
import com.navinfo.omqs.ui.other.BaseToast
|
||||||
import com.navinfo.omqs.ui.widget.SignUtil
|
import com.navinfo.omqs.ui.widget.SignUtil
|
||||||
import com.navinfo.omqs.util.DateTimeUtil
|
import com.navinfo.omqs.util.DateTimeUtil
|
||||||
|
import com.navinfo.omqs.util.ShareUtil
|
||||||
import com.navinfo.omqs.util.SoundMeter
|
import com.navinfo.omqs.util.SoundMeter
|
||||||
import com.navinfo.omqs.util.SpeakMode
|
import com.navinfo.omqs.util.SpeakMode
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
@ -74,7 +75,7 @@ class MainViewModel @Inject constructor(
|
|||||||
private val realmOperateHelper: RealmOperateHelper,
|
private val realmOperateHelper: RealmOperateHelper,
|
||||||
private val networkService: NetworkService,
|
private val networkService: NetworkService,
|
||||||
private val sharedPreferences: SharedPreferences
|
private val sharedPreferences: SharedPreferences
|
||||||
) : ViewModel(),SocketServer.OnConnectSinsListener{
|
) : ViewModel(), SocketServer.OnConnectSinsListener {
|
||||||
|
|
||||||
private var mCameraDialog: CommonDialog? = null
|
private var mCameraDialog: CommonDialog? = null
|
||||||
|
|
||||||
@ -130,10 +131,10 @@ class MainViewModel @Inject constructor(
|
|||||||
val liveDataCenterPoint = MutableLiveData<MapPosition>()
|
val liveDataCenterPoint = MutableLiveData<MapPosition>()
|
||||||
|
|
||||||
//状态
|
//状态
|
||||||
val qrCodeStatus: MutableLiveData<QrCodeStatus> = MutableLiveData()
|
val liveIndoorToolsResp: MutableLiveData<IndoorToolsResp> = MutableLiveData()
|
||||||
|
|
||||||
//状态
|
//状态
|
||||||
val indoorToolsStatus: MutableLiveData<IndoorToolsStatus> = MutableLiveData()
|
val liveIndoorToolsCommand: MutableLiveData<IndoorToolsCommand> = MutableLiveData()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是不是线选择模式
|
* 是不是线选择模式
|
||||||
@ -159,9 +160,11 @@ class MainViewModel @Inject constructor(
|
|||||||
|
|
||||||
private var lastNiLocaion: NiLocation? = null
|
private var lastNiLocaion: NiLocation? = null
|
||||||
|
|
||||||
var currentIndexNiLocation: Int = 0
|
private var currentIndexNiLocation: Int = 0
|
||||||
|
|
||||||
private var socketServer:SocketServer? = null
|
private var socketServer: SocketServer? = null
|
||||||
|
|
||||||
|
var indoorToolsCommand: IndoorToolsCommand? = null
|
||||||
|
|
||||||
init {
|
init {
|
||||||
mapController.mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
mapController.mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
|
||||||
@ -208,7 +211,7 @@ class MainViewModel @Inject constructor(
|
|||||||
initNILocationData()
|
initNILocationData()
|
||||||
}
|
}
|
||||||
|
|
||||||
socketServer = SocketServer(mapController,traceDataBase,sharedPreferences)
|
socketServer = SocketServer(mapController, traceDataBase, sharedPreferences)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -277,6 +280,7 @@ class MainViewModel @Inject constructor(
|
|||||||
@RequiresApi(Build.VERSION_CODES.N)
|
@RequiresApi(Build.VERSION_CODES.N)
|
||||||
private fun initLocation() {
|
private fun initLocation() {
|
||||||
|
|
||||||
|
val shareUtil = ShareUtil(mapController.mMapView.context, 1)
|
||||||
//用于定位点存储到数据库
|
//用于定位点存储到数据库
|
||||||
viewModelScope.launch(Dispatchers.Default) {
|
viewModelScope.launch(Dispatchers.Default) {
|
||||||
//用于定位点捕捉道路
|
//用于定位点捕捉道路
|
||||||
@ -309,20 +313,20 @@ class MainViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
val id = sharedPreferences.getInt(Constant.SELECT_TASK_ID, -1)
|
val id = sharedPreferences.getInt(Constant.SELECT_TASK_ID, -1)
|
||||||
location.taskId = id.toString()
|
location.taskId = id.toString()
|
||||||
|
if (shareUtil.connectstate) {
|
||||||
|
location.media = 1
|
||||||
|
}
|
||||||
|
var disance = 0.0
|
||||||
//增加间距判断
|
//增加间距判断
|
||||||
if (lastNiLocaion != null) {
|
if (lastNiLocaion != null) {
|
||||||
val disance = GeometryTools.getDistance(
|
disance = GeometryTools.getDistance(
|
||||||
location.latitude, location.longitude,
|
location.latitude, location.longitude,
|
||||||
lastNiLocaion!!.latitude, lastNiLocaion!!.longitude
|
lastNiLocaion!!.latitude, lastNiLocaion!!.longitude
|
||||||
)
|
)
|
||||||
//相距差距大于2.5米以上进行存储
|
|
||||||
if (disance > 2.5 && disance < 60) {
|
}
|
||||||
traceDataBase.niLocationDao.insert(location)
|
//室内整理工具时不能进行轨迹存储,判断轨迹间隔要超过2.5并小于60米
|
||||||
mapController.markerHandle.addNiLocationMarkerItem(location)
|
if (Constant.INDOOR_IP.isEmpty() && (disance == 0.0 || (disance > 2.5 && disance < 60))) {
|
||||||
mapController.mMapView.vtmMap.updateMap(true)
|
|
||||||
lastNiLocaion = location
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
traceDataBase.niLocationDao.insert(location)
|
traceDataBase.niLocationDao.insert(location)
|
||||||
mapController.markerHandle.addNiLocationMarkerItem(location)
|
mapController.markerHandle.addNiLocationMarkerItem(location)
|
||||||
mapController.mMapView.vtmMap.updateMap(true)
|
mapController.mMapView.vtmMap.updateMap(true)
|
||||||
@ -699,13 +703,19 @@ class MainViewModel @Inject constructor(
|
|||||||
liveDataSignMoreInfo.value = data
|
liveDataSignMoreInfo.value = data
|
||||||
}
|
}
|
||||||
|
|
||||||
fun sendServerCommand(context: Context, traceVideoBean: TraceVideoBean) {
|
fun sendServerCommand(
|
||||||
|
context: Context,
|
||||||
|
traceVideoBean: TraceVideoBean,
|
||||||
|
indoorToolsCommand: IndoorToolsCommand
|
||||||
|
) {
|
||||||
|
|
||||||
if (TextUtils.isEmpty(Constant.INDOOR_IP)) {
|
if (TextUtils.isEmpty(Constant.INDOOR_IP)) {
|
||||||
Toast.makeText(context, "获取ip失败!", Toast.LENGTH_LONG).show()
|
Toast.makeText(context, "获取ip失败!", Toast.LENGTH_LONG).show()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.indoorToolsCommand = indoorToolsCommand
|
||||||
|
|
||||||
viewModelScope.launch(Dispatchers.Default) {
|
viewModelScope.launch(Dispatchers.Default) {
|
||||||
val url = "http://${Constant.INDOOR_IP}:8080/sensor/service/${traceVideoBean.command}?"
|
val url = "http://${Constant.INDOOR_IP}:8080/sensor/service/${traceVideoBean.command}?"
|
||||||
|
|
||||||
@ -728,7 +738,8 @@ class MainViewModel @Inject constructor(
|
|||||||
"命令成功。",
|
"命令成功。",
|
||||||
Toast.LENGTH_LONG
|
Toast.LENGTH_LONG
|
||||||
).show()
|
).show()
|
||||||
qrCodeStatus.postValue(QrCodeStatus.QR_CODE_STATUS_UPDATE_VIDEO_INFO_SUCCESS)
|
|
||||||
|
liveIndoorToolsResp.postValue(IndoorToolsResp.QR_CODE_STATUS_UPDATE_VIDEO_INFO_SUCCESS)
|
||||||
|
|
||||||
//启动双向控制服务
|
//启动双向控制服务
|
||||||
|
|
||||||
@ -750,6 +761,7 @@ class MainViewModel @Inject constructor(
|
|||||||
)
|
)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
liveIndoorToolsResp.postValue(IndoorToolsResp.QR_CODE_STATUS_UPDATE_VIDEO_INFO_FAILURE)
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
@ -773,7 +785,7 @@ class MainViewModel @Inject constructor(
|
|||||||
)
|
)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
qrCodeStatus.postValue(QrCodeStatus.QR_CODE_STATUS_NET_FAILURE)
|
liveIndoorToolsResp.postValue(IndoorToolsResp.QR_CODE_STATUS_UPDATE_VIDEO_INFO_FAILURE)
|
||||||
}
|
}
|
||||||
|
|
||||||
is NetResult.Failure<*> -> {
|
is NetResult.Failure<*> -> {
|
||||||
@ -785,7 +797,7 @@ class MainViewModel @Inject constructor(
|
|||||||
)
|
)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
qrCodeStatus.postValue(QrCodeStatus.QR_CODE_STATUS_NET_FAILURE)
|
liveIndoorToolsResp.postValue(IndoorToolsResp.QR_CODE_STATUS_UPDATE_VIDEO_INFO_FAILURE)
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {}
|
else -> {}
|
||||||
@ -814,6 +826,34 @@ class MainViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 显示索引位置
|
||||||
|
* @param niLocation 轨迹点
|
||||||
|
*/
|
||||||
|
fun setCurrentIndexNiLocation(niLocation: NiLocation) {
|
||||||
|
viewModelScope.launch ( Dispatchers.IO ){
|
||||||
|
Log.e("qj","开始$currentIndexNiLocation")
|
||||||
|
currentIndexNiLocation = mapController.markerHandle.getNILocationIndex(niLocation)!!
|
||||||
|
Log.e("qj","结束$currentIndexNiLocation")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置索引位置
|
||||||
|
* @param index 索引
|
||||||
|
*/
|
||||||
|
fun setCurrentIndexLoction(index: Int) {
|
||||||
|
currentIndexNiLocation = index
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return index 索引
|
||||||
|
*/
|
||||||
|
fun getCurrentNiLocationIndex(): Int {
|
||||||
|
return currentIndexNiLocation
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束自动播放
|
* 结束自动播放
|
||||||
*/
|
*/
|
||||||
@ -833,22 +873,32 @@ class MainViewModel @Inject constructor(
|
|||||||
|
|
||||||
override fun onIndexing() {
|
override fun onIndexing() {
|
||||||
//切换为暂停状态
|
//切换为暂停状态
|
||||||
indoorToolsStatus.postValue(IndoorToolsStatus.PAUSE)
|
liveIndoorToolsCommand.postValue(IndoorToolsCommand.INDEXING)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStop() {
|
override fun onStop() {
|
||||||
TODO("Not yet implemented")
|
liveIndoorToolsCommand.postValue(IndoorToolsCommand.STOP)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPlay() {
|
override fun onPlay() {
|
||||||
TODO("Not yet implemented")
|
liveIndoorToolsCommand.postValue(IndoorToolsCommand.PLAY)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onParseEnd() {
|
override fun onParseEnd() {
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onReceiveLocation(mNiLocation: NiLocation?) {
|
override fun onReceiveLocation(mNiLocation: NiLocation?) {
|
||||||
TODO("Not yet implemented")
|
if (mNiLocation != null) {
|
||||||
|
setCurrentIndexNiLocation(mNiLocation)
|
||||||
|
showMarker(mapController.mMapView.context, mNiLocation)
|
||||||
|
Log.e("qj","反向控制$currentIndexNiLocation")
|
||||||
|
} else {
|
||||||
|
BaseToast.makeText(
|
||||||
|
mapController.mMapView.context,
|
||||||
|
"没有找到对应轨迹点!",
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -24,11 +24,25 @@ import java.util.Collections
|
|||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
|
|
||||||
|
|
||||||
enum class IndoorToolsStatus {
|
enum class IndoorToolsCommand {
|
||||||
PAUSE,
|
|
||||||
PLAY,
|
PLAY,
|
||||||
|
SELECT_POINT,
|
||||||
|
INDEXING,
|
||||||
NEXT,
|
NEXT,
|
||||||
REWIND
|
REWIND,
|
||||||
|
STOP
|
||||||
|
}
|
||||||
|
|
||||||
|
enum class IndoorToolsResp{
|
||||||
|
/**
|
||||||
|
* 信息更新轨迹成功
|
||||||
|
*/
|
||||||
|
QR_CODE_STATUS_UPDATE_VIDEO_INFO_SUCCESS,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息更新轨迹失败
|
||||||
|
*/
|
||||||
|
QR_CODE_STATUS_UPDATE_VIDEO_INFO_FAILURE,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -264,6 +278,7 @@ class SocketServer(
|
|||||||
timeIndex = mTaskList.size - 1
|
timeIndex = mTaskList.size - 1
|
||||||
val result = parseResult(mTaskList[timeIndex])
|
val result = parseResult(mTaskList[timeIndex])
|
||||||
var resultNiLocation: NiLocation? = null
|
var resultNiLocation: NiLocation? = null
|
||||||
|
var index: Int = -1
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
when (result.type) {
|
when (result.type) {
|
||||||
1 -> {
|
1 -> {
|
||||||
@ -277,6 +292,9 @@ class SocketServer(
|
|||||||
val currentTimeStr: String = DateTimeUtil.TimePointSSSToTime(
|
val currentTimeStr: String = DateTimeUtil.TimePointSSSToTime(
|
||||||
result.data
|
result.data
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Log.e(TAG, "反向"+result.data)
|
||||||
|
|
||||||
val startTime = currentTime - traceTimeBuffer
|
val startTime = currentTime - traceTimeBuffer
|
||||||
val endTme = currentTime + traceTimeBuffer
|
val endTme = currentTime + traceTimeBuffer
|
||||||
|
|
||||||
@ -291,21 +309,23 @@ class SocketServer(
|
|||||||
endTimeStr
|
endTimeStr
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
|
||||||
Log.e(TAG, "getTraceData开始")
|
Log.e(TAG, "getTraceData开始")
|
||||||
val list: List<NiLocation>? =
|
|
||||||
getTrackList(startTimeStr, endTimeStr, currentTimeStr)
|
val list: List<NiLocation>? = getTrackList(startTimeStr, endTimeStr, currentTimeStr)
|
||||||
|
|
||||||
Log.e(TAG, "getTraceData结束")
|
Log.e(TAG, "getTraceData结束")
|
||||||
|
|
||||||
if (list != null && list.size > 0) {
|
if (list != null && list.size > 0) {
|
||||||
|
|
||||||
var disTime: Long = 0
|
var disTime: Long = 0
|
||||||
|
|
||||||
|
|
||||||
//只有一个点不进行判断直接返回结果
|
//只有一个点不进行判断直接返回结果
|
||||||
if (list.size == 1) {
|
if (list.size == 1) {
|
||||||
resultNiLocation = list[0]
|
resultNiLocation = list[0]
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//遍历集合取最近时间的轨迹点
|
//遍历集合取最近时间的轨迹点
|
||||||
b@ for (nilocation in list) {
|
b@ for (nilocation in list) {
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(nilocation.time)) {
|
if (!TextUtils.isEmpty(nilocation.time)) {
|
||||||
|
|
||||||
//只获取到秒的常量
|
//只获取到秒的常量
|
||||||
@ -323,15 +343,13 @@ class SocketServer(
|
|||||||
//第一次不对比,取当前值
|
//第一次不对比,取当前值
|
||||||
if (disTime == 0L) {
|
if (disTime == 0L) {
|
||||||
disTime = disTimeTemp
|
disTime = disTimeTemp
|
||||||
resultNiLocation =
|
resultNiLocation = nilocation
|
||||||
nilocation
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
//前一个差值大于当前差值则取当前相对小的值
|
//前一个差值大于当前差值则取当前相对小的值
|
||||||
if (disTime - disTimeTemp > 0) {
|
if (disTime - disTimeTemp > 0) {
|
||||||
disTime = disTimeTemp
|
disTime = disTimeTemp
|
||||||
resultNiLocation =
|
resultNiLocation = nilocation
|
||||||
nilocation
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -343,6 +361,9 @@ class SocketServer(
|
|||||||
val msg1 = Message()
|
val msg1 = Message()
|
||||||
msg1.what = 0x11
|
msg1.what = 0x11
|
||||||
msg1.obj = resultNiLocation
|
msg1.obj = resultNiLocation
|
||||||
|
if (resultNiLocation != null) {
|
||||||
|
Log.e(TAG, "反向app"+resultNiLocation.time)
|
||||||
|
}
|
||||||
mHandler.sendMessage(msg1)
|
mHandler.sendMessage(msg1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,6 +394,7 @@ class SocketServer(
|
|||||||
mHandler.sendMessage(msg2)
|
mHandler.sendMessage(msg2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Thread.sleep(10)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
val msg = Message()
|
val msg = Message()
|
||||||
@ -407,7 +429,7 @@ class SocketServer(
|
|||||||
|
|
||||||
val id = sharedPreferences.getInt(Constant.SELECT_TASK_ID, -1)
|
val id = sharedPreferences.getInt(Constant.SELECT_TASK_ID, -1)
|
||||||
|
|
||||||
val list: MutableList<NiLocation> = traceDataBase.niLocationDao.taskIdAndTimeTofindList(id.toString(),startTime,endTime)
|
val list: MutableList<NiLocation> = traceDataBase.niLocationDao.findToTaskIdAll(id.toString())
|
||||||
|
|
||||||
if (list.size > 0) return list
|
if (list.size > 0) return list
|
||||||
}
|
}
|
||||||
@ -442,6 +464,7 @@ class SocketServer(
|
|||||||
connectFaild("连接断开")
|
connectFaild("连接断开")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Thread.sleep(10)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
connectFaild(e.toString())
|
connectFaild(e.toString())
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
|
@ -34,15 +34,6 @@ enum class QrCodeStatus {
|
|||||||
*/
|
*/
|
||||||
QR_CODE_STATUS_SERVER_INFO_SUCCESS,
|
QR_CODE_STATUS_SERVER_INFO_SUCCESS,
|
||||||
|
|
||||||
/**
|
|
||||||
* 信息更新轨迹成功
|
|
||||||
*/
|
|
||||||
QR_CODE_STATUS_UPDATE_VIDEO_INFO_SUCCESS,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 信息更新轨迹失败
|
|
||||||
*/
|
|
||||||
QR_CODE_STATUS_UPDATE_VIDEO_INFO_FAILURE,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
|
@ -61,12 +61,6 @@ class QrCodeActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
QrCodeStatus.QR_CODE_STATUS_SERVER_INFO_SUCCESS -> {
|
QrCodeStatus.QR_CODE_STATUS_SERVER_INFO_SUCCESS -> {
|
||||||
|
|
||||||
}
|
|
||||||
QrCodeStatus.QR_CODE_STATUS_UPDATE_VIDEO_INFO_SUCCESS -> {
|
|
||||||
|
|
||||||
}
|
|
||||||
QrCodeStatus.QR_CODE_STATUS_UPDATE_VIDEO_INFO_FAILURE -> {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,10 +116,10 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
|||||||
}
|
}
|
||||||
R.id.personal_center_menu_test -> {
|
R.id.personal_center_menu_test -> {
|
||||||
viewModel.readRealmData()
|
viewModel.readRealmData()
|
||||||
//108.91056000267433 34.29635901721207
|
//108.90107116103331 34.29568928574205
|
||||||
// 定位到指定位置
|
// 定位到指定位置
|
||||||
niMapController.mMapView.vtmMap.animator()
|
niMapController.mMapView.vtmMap.animator()
|
||||||
.animateTo(GeoPoint( 34.29635901721207, 108.91056000267433))
|
.animateTo(GeoPoint( 34.29568928574205, 108.90107116103331))
|
||||||
}
|
}
|
||||||
// R.id.personal_center_menu_task_list -> {
|
// R.id.personal_center_menu_task_list -> {
|
||||||
// findNavController().navigate(R.id.TaskManagerFragment)
|
// findNavController().navigate(R.id.TaskManagerFragment)
|
||||||
|
@ -1707,48 +1707,52 @@
|
|||||||
</m>0
|
</m>0
|
||||||
<!-- 道路边界类型 -->
|
<!-- 道路边界类型 -->
|
||||||
<m v="OMDB_RDBOUND_BOUNDARYTYPE">
|
<m v="OMDB_RDBOUND_BOUNDARYTYPE">
|
||||||
<outline-layer id="boundaryType" stroke="#fcba5a" width="0.2" />
|
<outline-layer id="boundaryType" stroke="#8e44ad" width="0.2" />
|
||||||
|
<m k="boundaryType" v="0|1|2|3|4|5|6|7|8|9">
|
||||||
|
<line stroke="#ffffff" use="boundaryType" width="0.2"/>
|
||||||
|
</m>
|
||||||
|
<!-- <outline-layer id="boundaryType" stroke="#fcba5a" width="0.2" />
|
||||||
<m k="boundaryType" v="0">
|
<m k="boundaryType" v="0">
|
||||||
<!--不应用-->
|
<!–不应用–>
|
||||||
<line stroke="#fcba5a" use="boundaryType"/>
|
<line stroke="#fcba5a" use="boundaryType"/>
|
||||||
<lineSymbol repeat-gap="12" repeat-start="12" symbol-height="16" symbol-width="16" src="assets:omdb/icon_2083_0.svg" />
|
<lineSymbol repeat-gap="12" repeat-start="12" symbol-height="16" symbol-width="16" src="assets:omdb/icon_2083_0.svg" />
|
||||||
</m>
|
</m>
|
||||||
<m k="boundaryType" v="1">
|
<m k="boundaryType" v="1">
|
||||||
<!--无标线无可区分边界-->
|
<!–无标线无可区分边界–>
|
||||||
<line dasharray="10,2,2,2,2,2,2,2" repeat-start="0" stroke="#fcba5a" width="0.2" />
|
<line dasharray="10,2,2,2,2,2,2,2" repeat-start="0" stroke="#fcba5a" width="0.2" />
|
||||||
</m>
|
</m>
|
||||||
<m k="boundaryType" v="2">
|
<m k="boundaryType" v="2">
|
||||||
<!--标线-->
|
<!–标线–>
|
||||||
<line stroke="#fcba5a" use="boundaryType"/>
|
<line stroke="#fcba5a" use="boundaryType"/>
|
||||||
</m>
|
</m>
|
||||||
<m k="boundaryType" v="3">
|
<m k="boundaryType" v="3">
|
||||||
<!--路牙-->
|
<!–路牙–>
|
||||||
<line dasharray="10,4" repeat-start="0" stroke="#fcba5a" width="0.2" />
|
<line dasharray="10,4" repeat-start="0" stroke="#fcba5a" width="0.2" />
|
||||||
</m>
|
</m>
|
||||||
<m k="boundaryType" v="4">
|
<m k="boundaryType" v="4">
|
||||||
<!--护栏-->
|
<!–护栏–>
|
||||||
<line dasharray="10,2,2,2" repeat-start="0" stroke="#fcba5a" width="0.2"/>
|
<line dasharray="10,2,2,2" repeat-start="0" stroke="#fcba5a" width="0.2"/>
|
||||||
</m>
|
</m>
|
||||||
<m k="boundaryType" v="5">
|
<m k="boundaryType" v="5">
|
||||||
<!--墙-->
|
<!–墙–>
|
||||||
<line stroke="#fcba5a" use="boundaryType"/>
|
<line stroke="#fcba5a" use="boundaryType"/>
|
||||||
<line dasharray="10,5" stroke="#fcba5a" width="0.5" />
|
<line dasharray="10,5" stroke="#fcba5a" width="0.5" />
|
||||||
</m>
|
</m>
|
||||||
<m k="boundaryType" v="6">
|
<m k="boundaryType" v="6">
|
||||||
<!--道路面铺设边缘-->
|
<!–道路面铺设边缘–>
|
||||||
<line stroke="#fcba5a" use="boundaryType"/>
|
<line stroke="#fcba5a" use="boundaryType"/>
|
||||||
<lineSymbol repeat-gap="32" repeat-start="0" symbol-height="32" src="assets:omdb/icon_2083_6.svg" />
|
<lineSymbol repeat-gap="32" repeat-start="0" symbol-height="32" src="assets:omdb/icon_2083_6.svg" />
|
||||||
</m>
|
</m>
|
||||||
<m k="boundaryType" v="7">
|
<m k="boundaryType" v="7">
|
||||||
<!--虚拟三角岛-->
|
<!–虚拟三角岛–>
|
||||||
<line stroke="#fcba5a" use="boundaryType"/>
|
<line stroke="#fcba5a" use="boundaryType"/>
|
||||||
<line src="assets:omdb/icon_2083_7_1.svg" symbol-height="12" symbol-width="12" symbol-percent="20" width="1" />
|
<line src="assets:omdb/icon_2083_7_1.svg" symbol-height="12" symbol-width="12" symbol-percent="20" width="1" />
|
||||||
</m>
|
</m>
|
||||||
<m k="boundaryType" v="9">
|
<m k="boundaryType" v="9">
|
||||||
<!--杆状障碍物-->
|
<!–杆状障碍物–>
|
||||||
<line stroke="#fcba5a" use="boundaryType"/>
|
<line stroke="#fcba5a" use="boundaryType"/>
|
||||||
<lineSymbol repeat-gap="16" repeat-start="12" symbol-height="24" symbol-width="8" src="assets:omdb/icon_2083_9.svg" />
|
<lineSymbol repeat-gap="16" repeat-start="12" symbol-height="24" symbol-width="8" src="assets:omdb/icon_2083_9.svg" />
|
||||||
</m>
|
</m>-->
|
||||||
</m>
|
</m>
|
||||||
<!-- 车道边界类型 -->
|
<!-- 车道边界类型 -->
|
||||||
<m v="OMDB_LANE_MARK_BOUNDARYTYPE">
|
<m v="OMDB_LANE_MARK_BOUNDARYTYPE">
|
||||||
@ -1758,9 +1762,9 @@
|
|||||||
<m v="2">
|
<m v="2">
|
||||||
<m k="markType">
|
<m k="markType">
|
||||||
<!--其他|实线-->
|
<!--其他|实线-->
|
||||||
<m v="0|1">
|
<m v="0|1|2|3|4|5|6|7|8">
|
||||||
<m k="markColor">
|
<m k="markColor">
|
||||||
<m v="0|1">
|
<m v="1">
|
||||||
<line stroke="#ffffff" use="boundaryType" />
|
<line stroke="#ffffff" use="boundaryType" />
|
||||||
</m>
|
</m>
|
||||||
<m v="2">
|
<m v="2">
|
||||||
@ -1772,12 +1776,12 @@
|
|||||||
<m v="7">
|
<m v="7">
|
||||||
<line stroke="#00ff00" use="boundaryType" />
|
<line stroke="#00ff00" use="boundaryType" />
|
||||||
</m>
|
</m>
|
||||||
<m v="9">
|
<m v="0|9">
|
||||||
<line stroke="#8e44ad" use="boundaryType" />
|
<line stroke="#8e44ad" use="boundaryType" />
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
<!--虚线-->
|
<!-- <!–虚线–>
|
||||||
<m v="2">
|
<m v="2">
|
||||||
<m k="markColor">
|
<m k="markColor">
|
||||||
<m v="0|1">
|
<m v="0|1">
|
||||||
@ -1802,18 +1806,17 @@
|
|||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
<!--导流区边线-->
|
<!–导流区边线–>
|
||||||
<m v="4">
|
<m v="4">
|
||||||
<line outline="boundary" stroke="#545D6C"></line>
|
<line outline="boundary" stroke="#545D6C"></line>
|
||||||
<lineSymbol repeat-gap="0.5" repeat-start="0"
|
<lineSymbol repeat-gap="0.5" repeat-start="0"
|
||||||
src="assets:omdb/icon_right.png" />
|
src="assets:omdb/icon_right.png" />
|
||||||
</m>
|
</m>-->
|
||||||
<!-- <!–铺设路面边缘–>-->
|
|
||||||
<!-- <m v="5">-->
|
|
||||||
<!-- <line outline="#ffffff" fix="true" src="assets:omdb/icon_close.png" stroke="#ffffffff" use="boundaryType"/>-->
|
|
||||||
<!-- </m>-->
|
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
<m v="0|1|3|4|5|6|7|8|9">
|
||||||
|
<line stroke="#ffffff" use="boundaryType"/>
|
||||||
|
</m>
|
||||||
</m>
|
</m>
|
||||||
</m>
|
</m>
|
||||||
|
|
||||||
|
@ -766,6 +766,27 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getNILocationIndex(niLocation: NiLocation):Int?{
|
||||||
|
|
||||||
|
var list = niLocationItemizedLayer.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 {
|
interface OnQsRecordItemClickListener {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user