修改桥 小分类问题
修改 匝道问题 修改数据上传字段改动问题 增加轨迹回放功能
This commit is contained in:
parent
f1c6773713
commit
b69f4fc9c6
@ -154,6 +154,7 @@
|
||||
"code": 2201,
|
||||
"name": "桥",
|
||||
"catch":true,
|
||||
"existSubCode": true,
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
|
@ -53,8 +53,8 @@ data class EvaluationInfo(
|
||||
@SerializedName("evaluationWay")
|
||||
val evaluationWay: Int = 2,//测评方式 1生产测评 2现场测评 服务字段定义为Integer,使用包装类,对应无值情况为空
|
||||
|
||||
@SerializedName("roadClassfcation")
|
||||
val roadClassfcation: Int = 1,//道路种别
|
||||
@SerializedName("roadClassifcation")
|
||||
val roadClassifcation: Int = 1,//道路种别
|
||||
|
||||
@SerializedName("roadFunctionGrade")
|
||||
val roadFunctionGrade: Int = 1,//道路功能等级
|
||||
|
@ -3,6 +3,7 @@ package com.navinfo.omqs.db
|
||||
import android.content.Context
|
||||
import android.database.Cursor.*
|
||||
import android.os.Build
|
||||
import android.provider.ContactsContract.Data
|
||||
import android.util.Log
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.blankj.utilcode.util.FileIOUtils
|
||||
@ -234,7 +235,7 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
continue
|
||||
}
|
||||
elementIndex += 1
|
||||
dataIndex +=1
|
||||
dataIndex += 1
|
||||
Log.d("ImportOMDBHelper", "解析第:${index + 1}行")
|
||||
val map = gson.fromJson<Map<String, Any>>(
|
||||
line,
|
||||
@ -313,12 +314,13 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
Log.d("ImportOMDBHelper", "解析===2处理name")
|
||||
Log.d("ImportOMDBHelper", "解析===1处理杆状物")
|
||||
|
||||
if(currentConfig.filterData){
|
||||
if (currentConfig.filterData) {
|
||||
when (renderEntity.code.toInt()) {
|
||||
|
||||
DataCodeEnum.OMDB_POLE.code.toInt() -> {
|
||||
//过滤树类型的杆状物,无需导入到数据库中
|
||||
val poleType = renderEntity.properties["poleType"]
|
||||
val poleType =
|
||||
renderEntity.properties["poleType"]
|
||||
if (poleType != null && poleType.toInt() == 2) {
|
||||
continue
|
||||
}
|
||||
@ -346,7 +348,7 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
renderEntity.properties["boundaryType"]
|
||||
if (boundaryType != null) {
|
||||
when (boundaryType.toInt()) {
|
||||
0, 1,3,4, 5, 7, 9 -> {
|
||||
0, 1, 3, 4, 5, 7, 9 -> {
|
||||
renderEntity.enable = 0
|
||||
Log.e(
|
||||
"qj",
|
||||
@ -380,8 +382,10 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
"linkOut"
|
||||
)
|
||||
) {
|
||||
var linkIn = renderEntity.properties["linkIn"]
|
||||
var linkOut = renderEntity.properties["linkOut"]
|
||||
var linkIn =
|
||||
renderEntity.properties["linkIn"]
|
||||
var linkOut =
|
||||
renderEntity.properties["linkOut"]
|
||||
if (linkIn != null && linkOut != null) {
|
||||
var checkMsg = "$linkIn$linkOut"
|
||||
if (resHashMap.containsKey(checkMsg)) {
|
||||
@ -529,7 +533,7 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
Log.d("ImportOMDBHelper", "解析===1子code处理")
|
||||
//对code编码需要特殊处理 存在多个属性值时,渲染优先级:SA>PA,存在多个属性值时,渲染优先级:FRONTAGE>MAIN_SIDE_A CCESS
|
||||
|
||||
if(currentConfig.existSubCode){
|
||||
if (currentConfig.existSubCode) {
|
||||
when (renderEntity.code.toInt()) {
|
||||
DataCodeEnum.OMDB_LINK_ATTRIBUTE.code.toInt() -> {
|
||||
|
||||
@ -580,6 +584,17 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
//桥
|
||||
DataCodeEnum.OMDB_BRIDGE.code.toInt() -> {
|
||||
when (renderEntity.properties["bridgeType"]) {
|
||||
"1" -> renderEntity.code =
|
||||
DataCodeEnum.OMDB_BRIDGE_1.code
|
||||
"2" -> renderEntity.code =
|
||||
DataCodeEnum.OMDB_BRIDGE_2.code
|
||||
// "3" -> renderEntity.code = DataCodeEnum.OMDB_BRIDGE_3.code
|
||||
else -> DataCodeEnum.OMDB_BRIDGE.code
|
||||
}
|
||||
}
|
||||
|
||||
DataCodeEnum.OMDB_RAMP.code.toInt() -> {
|
||||
/*匝道*/
|
||||
@ -694,7 +709,8 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
|
||||
if (renderEntity.table == DataCodeEnum.OMDB_NODE_FORM.name) {//特殊处理,因为code相同,使用表名判断
|
||||
//过滤不需要渲染的要素
|
||||
var formOfWay = renderEntity.properties["formOfWay"]
|
||||
var formOfWay =
|
||||
renderEntity.properties["formOfWay"]
|
||||
if (formOfWay != null && formOfWay.toInt() == 30) {
|
||||
renderEntity.enable = 2
|
||||
renderEntity.code =
|
||||
@ -758,7 +774,7 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
)
|
||||
elementIndex = 0
|
||||
tableImportTime = System.currentTimeMillis()
|
||||
if(insertIndex%20000==0){
|
||||
if (insertIndex % 20000 == 0) {
|
||||
Log.d(
|
||||
"ImportOMDBHelper",
|
||||
"表解析===结束用时时间===事物开始"
|
||||
@ -768,12 +784,16 @@ class ImportOMDBHelper @AssistedInject constructor(
|
||||
Log.d(
|
||||
"ImportOMDBHelper",
|
||||
"表解析===结束用时时间===事物结束"
|
||||
) }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Realm.getInstance(currentInstallTaskConfig).commitTransaction()
|
||||
Realm.getInstance(currentInstallTaskConfig).close()
|
||||
Log.d("ImportOMDBHelper", "表解析===结束用时时间${(System.currentTimeMillis() - dataImportTime)}===$dataIndex===插入$insertIndex")
|
||||
Log.d(
|
||||
"ImportOMDBHelper",
|
||||
"表解析===结束用时时间${(System.currentTimeMillis() - dataImportTime)}===$dataIndex===插入$insertIndex"
|
||||
)
|
||||
Log.e("qj", "安装结束")
|
||||
} catch (e: Exception) {
|
||||
if (Realm.getInstance(currentInstallTaskConfig).isInTransaction) {
|
||||
|
@ -173,7 +173,7 @@ class TaskUploadScope(
|
||||
evaluatorName = "",
|
||||
evaluationDate = "",
|
||||
evaluationWay = 2,
|
||||
roadClassfcation = 1,
|
||||
roadClassifcation = 1,
|
||||
roadFunctionGrade = 0,
|
||||
noEvaluationreason = hadLinkDvoBean.reason,
|
||||
linkLength = 0.0,
|
||||
@ -211,14 +211,14 @@ class TaskUploadScope(
|
||||
}
|
||||
}
|
||||
|
||||
var roadClassfcation = 0
|
||||
var roadClassifcation = 0
|
||||
|
||||
var roadFunctionGrade = 0
|
||||
|
||||
var dataLevel = 0
|
||||
|
||||
if (hadLinkDvoBean.linkInfo != null) {
|
||||
roadClassfcation = hadLinkDvoBean.linkInfo!!.kind
|
||||
roadClassifcation = hadLinkDvoBean.linkInfo!!.kind
|
||||
roadFunctionGrade = hadLinkDvoBean.linkInfo!!.functionLevel
|
||||
dataLevel = hadLinkDvoBean.linkInfo!!.dataLevel
|
||||
}
|
||||
@ -243,7 +243,7 @@ class TaskUploadScope(
|
||||
evaluatorName = it.checkUserId,
|
||||
evaluationDate = it.checkTime,
|
||||
evaluationWay = evaluationWay,
|
||||
roadClassfcation = roadClassfcation,
|
||||
roadClassifcation = roadClassifcation,
|
||||
roadFunctionGrade = roadFunctionGrade,
|
||||
noEvaluationreason = "",
|
||||
linkLength = s.toDouble(),
|
||||
|
@ -50,6 +50,7 @@ import io.realm.Realm
|
||||
import io.realm.RealmConfiguration
|
||||
import io.realm.RealmSet
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
@ -234,6 +235,9 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
private var currentMapZoomLevel: Int = 0
|
||||
|
||||
//导航轨迹回顾
|
||||
private var naviLocationTest = false
|
||||
|
||||
//导航信息
|
||||
private var naviEngine: NaviEngine? = null
|
||||
|
||||
@ -487,10 +491,9 @@ class MainViewModel @Inject constructor(
|
||||
if (currentTaskBean != null) {
|
||||
var list = mutableListOf<QsRecordBean>()
|
||||
val realm = realmOperateHelper.getRealmDefaultInstance()
|
||||
realm.executeTransaction {
|
||||
val objects = realmOperateHelper.getRealmTools(QsRecordBean::class.java).findAll()
|
||||
list = realm.copyFromRealm(objects)
|
||||
}
|
||||
val id = sharedPreferences.getInt(Constant.SELECT_TASK_ID, -1)
|
||||
val objects = realm.where(QsRecordBean::class.java).equalTo("taskId", id).findAll()
|
||||
list = realm.copyFromRealm(objects)
|
||||
realm.close()
|
||||
mapController.markerHandle.removeAllQsMarker()
|
||||
for (item in list) {
|
||||
@ -541,7 +544,11 @@ class MainViewModel @Inject constructor(
|
||||
mapController.locationLayerHandler.niLocationFlow.collect { location ->
|
||||
|
||||
//过滤掉无效点
|
||||
if (!GeometryTools.isCheckError(location.longitude, location.latitude)) {
|
||||
if (!naviLocationTest && !GeometryTools.isCheckError(
|
||||
location.longitude,
|
||||
location.latitude
|
||||
)
|
||||
) {
|
||||
val geometry = GeometryTools.createGeometry(
|
||||
GeoPoint(
|
||||
location.latitude, location.longitude
|
||||
@ -698,7 +705,16 @@ class MainViewModel @Inject constructor(
|
||||
DataCodeEnum.OMDB_LINK_SPEEDLIMIT.code, //线限速,
|
||||
DataCodeEnum.OMDB_LINK_DIRECT.code,//道路方向,
|
||||
DataCodeEnum.OMDB_RAMP.code, //匝道
|
||||
DataCodeEnum.OMDB_RAMP_1.code,
|
||||
DataCodeEnum.OMDB_RAMP_2.code,
|
||||
DataCodeEnum.OMDB_RAMP_3.code,
|
||||
DataCodeEnum.OMDB_RAMP_4.code,
|
||||
DataCodeEnum.OMDB_RAMP_5.code,
|
||||
DataCodeEnum.OMDB_RAMP_6.code,
|
||||
DataCodeEnum.OMDB_RAMP_7.code,
|
||||
DataCodeEnum.OMDB_BRIDGE.code,//桥
|
||||
DataCodeEnum.OMDB_BRIDGE_1.code,
|
||||
DataCodeEnum.OMDB_BRIDGE_2.code,
|
||||
DataCodeEnum.OMDB_TUNNEL.code,//隧道
|
||||
DataCodeEnum.OMDB_ROUNDABOUT.code,//环岛
|
||||
DataCodeEnum.OMDB_LINK_ATTRIBUTE_MAIN_SIDE_ACCESS.code,//出入口
|
||||
@ -842,7 +858,17 @@ class MainViewModel @Inject constructor(
|
||||
DataCodeEnum.OMDB_LINK_SPEEDLIMIT_COND.code,//条件线限速
|
||||
DataCodeEnum.OMDB_LINK_DIRECT.code,//道路方向,
|
||||
DataCodeEnum.OMDB_RAMP.code, //匝道
|
||||
DataCodeEnum.OMDB_RAMP_1.code,
|
||||
DataCodeEnum.OMDB_RAMP_2.code,
|
||||
DataCodeEnum.OMDB_RAMP_3.code,
|
||||
DataCodeEnum.OMDB_RAMP_4.code,
|
||||
DataCodeEnum.OMDB_RAMP_5.code,
|
||||
DataCodeEnum.OMDB_RAMP_6.code,
|
||||
DataCodeEnum.OMDB_RAMP_7.code,
|
||||
DataCodeEnum.OMDB_BRIDGE.code,//桥
|
||||
DataCodeEnum.OMDB_BRIDGE_1.code,//桥
|
||||
DataCodeEnum.OMDB_BRIDGE_2.code,//桥
|
||||
|
||||
DataCodeEnum.OMDB_TUNNEL.code,//隧道
|
||||
DataCodeEnum.OMDB_ROUNDABOUT.code,//环岛
|
||||
DataCodeEnum.OMDB_LINK_ATTRIBUTE_MAIN_SIDE_ACCESS.code,//出入口
|
||||
@ -1610,5 +1636,57 @@ class MainViewModel @Inject constructor(
|
||||
fun clearMarker() {
|
||||
mapController.markerHandle.removeMarker()
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航测试
|
||||
*/
|
||||
fun setNaviLocationTestStartTime(time: Long) {
|
||||
stopNaviLocationTest()
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
var b = true
|
||||
while (b) {
|
||||
val list = traceDataBase.niLocationDao.findListWithStartTime(time, 20)
|
||||
var lastTime: Long = 0
|
||||
for (location in list) {
|
||||
if(!naviLocationTest)
|
||||
break
|
||||
lastTime = if (lastTime != 0L) {
|
||||
val nowTime = location.timeStamp.toLong()
|
||||
val tempTime = nowTime - lastTime
|
||||
if (tempTime > 10000) {
|
||||
liveDataMessage.postValue("下个定位点与当前定位点时间间隔超过10秒(${tempTime}),将直接跳转到下个点")
|
||||
delay(5000)
|
||||
} else {
|
||||
delay(tempTime)
|
||||
}
|
||||
nowTime
|
||||
} else {
|
||||
location.timeStamp.toLong()
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
mapController.animationHandler.animationByLatLon(
|
||||
location.latitude,
|
||||
location.longitude
|
||||
)
|
||||
}
|
||||
|
||||
mapController.locationLayerHandler.niLocationFlow.emit(location)
|
||||
}
|
||||
if (list.size < 100) {
|
||||
b = false
|
||||
}
|
||||
}
|
||||
mapController.locationLayerHandler.startLocation()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止测试
|
||||
*/
|
||||
fun stopNaviLocationTest() {
|
||||
mapController.locationLayerHandler.startLocation()
|
||||
naviLocationTest = false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,20 +2,28 @@ package com.navinfo.omqs.ui.dialog
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.DatePicker
|
||||
import android.widget.TextView
|
||||
import android.widget.TimePicker
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.navinfo.omqs.R
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
interface OnTimeDialogListener {
|
||||
fun selectTime(milliseconds: Long)
|
||||
}
|
||||
|
||||
class TimeDialog(context: Context) : Dialog(context), View.OnClickListener {
|
||||
class TimeDialog(context: Context, val listener: OnTimeDialogListener) : Dialog(context),
|
||||
View.OnClickListener {
|
||||
|
||||
private lateinit var dataPicker: DatePicker
|
||||
private lateinit var timePicker: TimePicker
|
||||
|
||||
|
||||
private var timeText = ""
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val customFrame = View.inflate(context, R.layout.dialog_time_layout, null)
|
||||
@ -26,10 +34,30 @@ class TimeDialog(context: Context) : Dialog(context), View.OnClickListener {
|
||||
setContentView(customFrame)
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.time_dialog_ok -> {
|
||||
// dataPicker.
|
||||
val month = if (dataPicker.month > 8) {
|
||||
"${dataPicker.month + 1}"
|
||||
} else {
|
||||
"0${dataPicker.month + 1}"
|
||||
}
|
||||
val hour = if(timePicker.hour < 10){
|
||||
"0${timePicker.hour}"
|
||||
}else{
|
||||
"${timePicker.hour}"
|
||||
}
|
||||
val minute = if(timePicker.minute<10){
|
||||
"0${timePicker.minute}"
|
||||
}else{
|
||||
"${timePicker.minute}"
|
||||
}
|
||||
val time =
|
||||
"${dataPicker.year}${month}${dataPicker.dayOfMonth}${hour}${minute}00"
|
||||
Log.e("jingo", "选择的时间 $time")
|
||||
val sdf = SimpleDateFormat("yyyyMMddHHmmss")
|
||||
listener.selectTime(sdf.parse(time).time)
|
||||
dismiss()
|
||||
}
|
||||
R.id.time_dialog_cancel -> {
|
||||
|
@ -181,6 +181,7 @@ class ConsoleFragment : BaseFragment(), OnClickListener {
|
||||
*/
|
||||
binding.consoleRoot.findViewById<View>(R.id.console_route_bg)?.setOnClickListener(this)
|
||||
binding.consoleRoot.findViewById<View>(R.id.console_route_icon_bg)?.setOnClickListener(this)
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
@ -33,6 +33,7 @@ import com.navinfo.omqs.hilt.ImportOMDBHiltFactory
|
||||
import com.navinfo.omqs.tools.CoroutineUtils
|
||||
import com.navinfo.omqs.ui.activity.map.MainViewModel
|
||||
import com.navinfo.omqs.ui.activity.scan.QrCodeActivity
|
||||
import com.navinfo.omqs.ui.dialog.OnTimeDialogListener
|
||||
import com.navinfo.omqs.ui.dialog.TimeDialog
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.permissionx.guolindev.PermissionX
|
||||
@ -206,8 +207,14 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
||||
}
|
||||
//导航定位测试
|
||||
R.id.personal_center_menu_location_test -> {
|
||||
viewMainModel.stopNaviLocationTest()
|
||||
val dialog = TimeDialog(
|
||||
requireContext(),
|
||||
object : OnTimeDialogListener {
|
||||
override fun selectTime(milliseconds: Long) {
|
||||
viewMainModel.setNaviLocationTestStartTime(milliseconds)
|
||||
}
|
||||
}
|
||||
)
|
||||
dialog.show()
|
||||
}
|
||||
|
@ -85,6 +85,13 @@ class SignUtil {
|
||||
if (data.properties["conAccess"] === "1") "全封闭" else ""
|
||||
}
|
||||
//匝道
|
||||
DataCodeEnum.OMDB_RAMP_1.code,
|
||||
DataCodeEnum.OMDB_RAMP_2.code,
|
||||
DataCodeEnum.OMDB_RAMP_3.code,
|
||||
DataCodeEnum.OMDB_RAMP_4.code,
|
||||
DataCodeEnum.OMDB_RAMP_5.code,
|
||||
DataCodeEnum.OMDB_RAMP_6.code,
|
||||
DataCodeEnum.OMDB_RAMP_7.code,
|
||||
DataCodeEnum.OMDB_RAMP.code -> {
|
||||
when (data.properties["formOfWay"]) {
|
||||
"93" -> "普通匝"
|
||||
@ -110,6 +117,8 @@ class SignUtil {
|
||||
if (data.properties["multiDigitized"] == "1") "上下线" else " "
|
||||
}
|
||||
//桥
|
||||
DataCodeEnum.OMDB_BRIDGE_1.code,//桥
|
||||
DataCodeEnum.OMDB_BRIDGE_2.code,//桥
|
||||
DataCodeEnum.OMDB_BRIDGE.code -> {
|
||||
when (data.properties["bridgeType"]) {
|
||||
"1" -> return "固定桥"
|
||||
|
@ -5,7 +5,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
tools:context="com.navinfo.omqs.ui.dialog.TimeDialog">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -53,12 +54,13 @@
|
||||
android:padding="5dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/red"
|
||||
android:text="取消"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
@ -9,6 +9,7 @@ import androidx.room.Update;
|
||||
|
||||
import com.navinfo.collect.library.data.entity.Element;
|
||||
import com.navinfo.collect.library.data.entity.NiLocation;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@ -42,13 +43,16 @@ public interface INiLocationDao {
|
||||
List<NiLocation> findList(int minx, int maxx, int miny, int maxy);
|
||||
|
||||
@Query("SELECT * FROM niLocation where tilex>=:minx and tilex<=:maxx and tiley>=:miny and tiley <=:maxy and time>=:startTime and time<=:endTime")
|
||||
List<NiLocation> timeTofindList(int minx, int maxx, int miny, int maxy,long startTime,long endTime);
|
||||
List<NiLocation> timeTofindList(int minx, int maxx, int miny, int maxy, long startTime, long endTime);
|
||||
|
||||
@Query("SELECT * FROM niLocation")
|
||||
List<NiLocation> findAll();
|
||||
|
||||
@Query("SELECT * FROM niLocation where time>=:startTime and time<=:endTime and taskId=:taskId")
|
||||
List<NiLocation> taskIdAndTimeTofindList(String taskId,long startTime,long endTime);
|
||||
List<NiLocation> taskIdAndTimeTofindList(String taskId, long startTime, long endTime);
|
||||
|
||||
@Query("SELECT * FROM niLocation where time>=:startTime limit:limit")
|
||||
List<NiLocation> findListWithStartTime(long startTime, int limit);
|
||||
|
||||
@Query("SELECT * FROM niLocation where taskId =:taskId")
|
||||
List<NiLocation> findToTaskIdAll(String taskId);
|
||||
|
@ -37,6 +37,9 @@ enum class DataCodeEnum(var tableName: String, var code: String) {
|
||||
OMDB_RDBOUND_BOUNDARYTYPE("道路边界类型", "2083"),
|
||||
OMDB_LANE_CONSTRUCTION("车道施工", "2090"),
|
||||
OMDB_BRIDGE("桥", "2201"),
|
||||
OMDB_BRIDGE_1("固定桥", "2201-1"),
|
||||
OMDB_BRIDGE_2("可移动桥", "2201-2"),
|
||||
OMDB_BRIDGE_3("跨线天桥", "2201-2"),
|
||||
OMDB_TUNNEL("隧道", "2202"),
|
||||
OMDB_ROUNDABOUT("环岛", "2204"),
|
||||
OMDB_LINK_FORM1("道路形态1", "2205"),
|
||||
|
@ -26,6 +26,11 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
private var bFirst = true
|
||||
private val mLocationLayer: LocationLayer = LocationLayer(mMapView.vtmMap)
|
||||
private lateinit var locationClient: LocationClient
|
||||
|
||||
/**
|
||||
* 定位测试
|
||||
*/
|
||||
private var naviLocationTest = false
|
||||
// private var niLocationListener: NiLocationListener by lazy{
|
||||
//
|
||||
// }
|
||||
@ -64,6 +69,10 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
|
||||
//获取经纬度坐标类型,以LocationClientOption中设置过的坐标类型为准
|
||||
// val coorType = it.coorType
|
||||
//获取定位类型、定位错误返回码,具体信息可参照类参考中BDLocation类中的说明
|
||||
//定位测试开始,后续不再处理
|
||||
if (naviLocationTest)
|
||||
return@MyLocationListener
|
||||
|
||||
val errorCode = it.locType
|
||||
mCurrentLocation = it
|
||||
mLocationLayer.setPosition(it.latitude, it.longitude, it.radius)
|
||||
@ -215,7 +224,7 @@ private class MyLocationListener(callback: (BDLocation) -> Unit) : BDAbstractLoc
|
||||
val call = callback;
|
||||
override fun onReceiveLocation(location: BDLocation) {
|
||||
call(location)
|
||||
Log.e("jingo", "定位结果:速度=" + location.speed +" 方向=" + location.direction)
|
||||
Log.e("jingo", "定位结果:速度=" + location.speed + " 方向=" + location.direction)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user