Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
Conflicts: app/src/main/AndroidManifest.xml app/src/main/java/com/navinfo/omqs/ui/fragment/console/ConsoleFragment.kt app/src/main/java/com/navinfo/omqs/ui/fragment/layermanager/LayerManagerFragment.kt
This commit is contained in:
@@ -13,10 +13,15 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
open class BaseActivity : AppCompatActivity() {
|
||||
private var loadingDialog: AlertDialog? = null
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE//横屏
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 显示loading dialog
|
||||
*/
|
||||
|
||||
@@ -78,6 +78,9 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
// var testPoint = GeoPoint(0, 0)
|
||||
|
||||
//uuid标识,用于记录轨迹组
|
||||
val uuid = UUID.randomUUID().toString()
|
||||
|
||||
//语音窗体
|
||||
private var pop: PopupWindow? = null
|
||||
|
||||
@@ -160,15 +163,9 @@ class MainViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
private fun initLocation() {
|
||||
// mapController.locationLayerHandler.setNiLocationListener(NiLocationListener {
|
||||
// addSaveTrace(it)
|
||||
//
|
||||
// })
|
||||
//用于定位点存储到数据库
|
||||
viewModelScope.launch(Dispatchers.Default) {
|
||||
mapController.locationLayerHandler.niLocationFlow.collect { location ->
|
||||
// location.longitude = testPoint.longitude
|
||||
// location.latitude = testPoint.latitude
|
||||
val geometry = GeometryTools.createGeometry(
|
||||
GeoPoint(
|
||||
location.latitude, location.longitude
|
||||
@@ -186,7 +183,13 @@ class MainViewModel @Inject constructor(
|
||||
location.tiley = y
|
||||
}
|
||||
}
|
||||
Log.e("jingo", "定位点插入 ${Thread.currentThread().name}")
|
||||
Log.e("jingo", "定位点插入 ${location.longitude}")
|
||||
location.groupId = uuid
|
||||
try {
|
||||
location.timeStamp = DateTimeUtil.getTime(location.time).toString()
|
||||
}catch (e: Exception){
|
||||
|
||||
}
|
||||
traceDataBase.niLocationDao.insert(location)
|
||||
mapController.mMapView.vtmMap.updateMap(true)
|
||||
}
|
||||
@@ -194,8 +197,6 @@ class MainViewModel @Inject constructor(
|
||||
//用于定位点捕捉道路
|
||||
viewModelScope.launch(Dispatchers.Default) {
|
||||
mapController.locationLayerHandler.niLocationFlow.collectLatest { location ->
|
||||
// location.longitude = testPoint.longitude
|
||||
// location.latitude = testPoint.latitude
|
||||
if (!isSelectRoad()) captureLink(GeoPoint(location.latitude, location.longitude))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user