This commit is contained in:
qiji4215 2023-05-05 16:58:22 +08:00
commit 9929423a3b
16 changed files with 190 additions and 74 deletions

View File

@ -1,7 +1,10 @@
package com.navinfo.omqs.bean package com.navinfo.omqs.bean
import android.os.Parcelable
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import kotlinx.android.parcel.Parcelize
@Parcelize
data class EvaluationInfo( data class EvaluationInfo(
@SerializedName("evaluationTaskId") @SerializedName("evaluationTaskId")
val evaluationTaskId: String = "",//测评任务id val evaluationTaskId: String = "",//测评任务id
@ -46,5 +49,5 @@ data class EvaluationInfo(
@SerializedName("evaluationWay") @SerializedName("evaluationWay")
val evaluationWay: String = ""//测评方式 val evaluationWay: String = ""//测评方式
) ) : Parcelable

View File

@ -24,6 +24,7 @@ import io.realm.Realm
import kotlinx.coroutines.* import kotlinx.coroutines.*
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Call
import retrofit2.Retrofit import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@ -66,7 +67,7 @@ class GlobalModule {
}.apply { }.apply {
level = if (Constant.DEBUG) { level = if (Constant.DEBUG) {
//坑 下载文件时打印log 内存不足 //坑 下载文件时打印log 内存不足
HttpLoggingInterceptor.Level.BASIC HttpLoggingInterceptor.Level.BODY
} else { } else {
HttpLoggingInterceptor.Level.NONE HttpLoggingInterceptor.Level.NONE
} }
@ -92,9 +93,12 @@ class GlobalModule {
@Singleton @Singleton
fun provideGson(): Gson = GsonBuilder() fun provideGson(): Gson = GsonBuilder()
// 解决解析Json时将int类型自动转换为Double的问题 // 解决解析Json时将int类型自动转换为Double的问题
.registerTypeAdapter(object : TypeToken<Map<String, Any?>>() {}.getType(), IntTypeAdapter()) .registerTypeAdapter(object : TypeToken<Map<String, Any?>>() {}.type, IntTypeAdapter())
.registerTypeAdapter(object : TypeToken<Map<String, Any>>() {}.getType(), IntTypeAdapter()) .registerTypeAdapter(object : TypeToken<Map<String, Any>>() {}.type, IntTypeAdapter())
.registerTypeAdapter(object : TypeToken<Map<Any, Any>>() {}.getType(), IntTypeAdapter()) .registerTypeAdapter(object : TypeToken<Map<Any, Any>>() {}.type, IntTypeAdapter())
// .registerTypeAdapter(Call::class.java, object : TypeToken<Call<*>>(){
//
// })
.create() .create()
@Provides @Provides

View File

@ -58,7 +58,7 @@ interface RetrofitNetworkServiceAPI {
@Headers("Content-Type: application/json") @Headers("Content-Type: application/json")
@POST("/devcp/upload") @POST("/devcp/upload")
suspend fun postRequest(@Body listEvaluationInfo: List<EvaluationInfo>?): Call<ResponseBody> suspend fun postRequest(@Body listEvaluationInfo: List<EvaluationInfo>?): Response<ResponseBody>
/** /**
* @FormUrlEncoded 请求格式注解请求实体是一个From表单每个键值对需要使用@Field注解 * @FormUrlEncoded 请求格式注解请求实体是一个From表单每个键值对需要使用@Field注解

View File

@ -9,6 +9,7 @@ import androidx.lifecycle.Observer
import com.navinfo.collect.library.data.entity.QsRecordBean import com.navinfo.collect.library.data.entity.QsRecordBean
import com.navinfo.omqs.bean.EvaluationInfo import com.navinfo.omqs.bean.EvaluationInfo
import com.navinfo.omqs.bean.TaskBean import com.navinfo.omqs.bean.TaskBean
import com.navinfo.omqs.http.NetResult
import com.navinfo.omqs.tools.FileManager import com.navinfo.omqs.tools.FileManager
import com.navinfo.omqs.tools.FileManager.Companion.FileUploadStatus import com.navinfo.omqs.tools.FileManager.Companion.FileUploadStatus
import io.realm.Realm import io.realm.Realm
@ -114,9 +115,16 @@ class TaskUploadScope(
taskBean.hadLinkDvoList.forEach { hadLinkDvoBean -> taskBean.hadLinkDvoList.forEach { hadLinkDvoBean ->
val objects = realm.where(QsRecordBean::class.java) val objects = realm.where(QsRecordBean::class.java)
.equalTo("linkId", /*"84207223282277331"*/hadLinkDvoBean.linkPid).findAll() .equalTo("linkId", /*"84207223282277331"*/hadLinkDvoBean.linkPid).findAll()
if(objects.size == 0){
// change(FileUploadStatus.NONE)
return
}
val bodyList: MutableList<EvaluationInfo> = ArrayList() val bodyList: MutableList<EvaluationInfo> = ArrayList()
if (objects != null) { if (objects != null) {
objects.forEach{ val copyList =realm.copyFromRealm(objects)
copyList.forEach {
val evaluationInfo = EvaluationInfo( val evaluationInfo = EvaluationInfo(
taskBean.id.toString(), taskBean.id.toString(),
hadLinkDvoBean.linkPid,//"84207223282277331" hadLinkDvoBean.linkPid,//"84207223282277331"
@ -137,26 +145,20 @@ class TaskUploadScope(
bodyList.add(evaluationInfo) bodyList.add(evaluationInfo)
} }
uploadManager.netApi.postRequest(bodyList).enqueue(object : val result = uploadManager.netApi.postRequest(bodyList)// .enqueue(object :
Callback<ResponseBody> { // Callback<ResponseBody> {
override fun onResponse( if (result.isSuccessful) {
call: Call<ResponseBody>, if (result.code() == 200) {
response: Response<ResponseBody>
) {
if (response.code() == 200) {
taskBean.syncStatus = FileUploadStatus.DONE taskBean.syncStatus = FileUploadStatus.DONE
// handle the response // handle the response
Log.e("qj", "")
change(FileUploadStatus.DONE) change(FileUploadStatus.DONE)
} } else {
}
override fun onFailure(call: Call<ResponseBody>, t: Throwable) {
// handle the failure // handle the failure
Log.e("qj", "")
change(FileUploadStatus.ERROR) change(FileUploadStatus.ERROR)
} }
}) } else {
change(FileUploadStatus.ERROR)
}
} }
} }

View File

@ -17,8 +17,9 @@ class LayerConfigUtils {
fun getLayerConfigList(): List<ImportConfig> { fun getLayerConfigList(): List<ImportConfig> {
// 首先读取Shared文件如果存在则直接返回否则读取config文件 // 首先读取Shared文件如果存在则直接返回否则读取config文件
return SPStaticUtils.getString(Constant.EVENT_LAYER_MANAGER_CHANGE, null).let { return SPStaticUtils.getString(Constant.EVENT_LAYER_MANAGER_CHANGE, null).let {
if (it!=null) { if (it != null) {
val result: List<ImportConfig> = gson.fromJson(it, object : TypeToken<List<ImportConfig>>(){}.type) val result: List<ImportConfig> =
gson.fromJson(it, object : TypeToken<List<ImportConfig>>() {}.type)
result result
} else { } else {
LayerConfigUtils.getLayerConfigListFromAssetsFile() LayerConfigUtils.getLayerConfigListFromAssetsFile()
@ -35,7 +36,8 @@ class LayerConfigUtils {
} }
if (otherConfigFile.exists()) { if (otherConfigFile.exists()) {
val otherConfiStr = FileIOUtils.readFile2String(otherConfigFile) val otherConfiStr = FileIOUtils.readFile2String(otherConfigFile)
val otherConfig = gson.fromJson<ImportConfig>(otherConfiStr, ImportConfig::class.java) val otherConfig =
gson.fromJson<ImportConfig>(otherConfiStr, ImportConfig::class.java)
resultList.add(otherConfig) resultList.add(otherConfig)
} }
return resultList return resultList

View File

@ -91,6 +91,8 @@ class EvaluationResultViewModel @Inject constructor(
var mSoundMeter: SoundMeter? = null var mSoundMeter: SoundMeter? = null
var classTypeTemp: String = ""
init { init {
liveDataQsRecordBean.value = QsRecordBean(id = UUID.randomUUID().toString()) liveDataQsRecordBean.value = QsRecordBean(id = UUID.randomUUID().toString())
Log.e("jingo", "EvaluationResultViewModel 创建了 ${hashCode()}") Log.e("jingo", "EvaluationResultViewModel 创建了 ${hashCode()}")
@ -118,7 +120,7 @@ class EvaluationResultViewModel @Inject constructor(
/** /**
* 查询数据库获取问题分类 * 查询数据库获取问题分类
*/ */
fun initNewData(bean: SignBean?,filePath: String) { fun initNewData(bean: SignBean?, filePath: String) {
viewModelScope.launch(Dispatchers.IO) { viewModelScope.launch(Dispatchers.IO) {
getClassTypeList() getClassTypeList()
getProblemLinkList() getProblemLinkList()
@ -128,6 +130,7 @@ class EvaluationResultViewModel @Inject constructor(
geoPoint?.let { geoPoint?.let {
liveDataQsRecordBean.value!!.geometry = GeometryTools.createGeometry(it).toText() liveDataQsRecordBean.value!!.geometry = GeometryTools.createGeometry(it).toText()
mapController.markerHandle.addMarker(geoPoint, markerTitle) mapController.markerHandle.addMarker(geoPoint, markerTitle)
mapController.animationHandler.animationByLonLat(geoPoint.latitude,geoPoint.longitude)
viewModelScope.launch { viewModelScope.launch {
captureLink(geoPoint.longitude, geoPoint.latitude) captureLink(geoPoint.longitude, geoPoint.latitude)
} }
@ -148,6 +151,8 @@ class EvaluationResultViewModel @Inject constructor(
} }
} }
val point = GeometryTools.createGeoPoint(bean.geometry) val point = GeometryTools.createGeoPoint(bean.geometry)
liveDataQsRecordBean.value!!.geometry = GeometryTools.createGeometry(point).toText()
mapController.animationHandler.animationByLonLat(point.latitude,point.longitude)
mapController.markerHandle.addMarker(point, markerTitle) mapController.markerHandle.addMarker(point, markerTitle)
} }
@ -171,6 +176,7 @@ class EvaluationResultViewModel @Inject constructor(
it.linkId = it.linkId =
linkList[0].properties[LinkTable.linkPid] ?: "" linkList[0].properties[LinkTable.linkPid] ?: ""
mapController.lineHandler.showLine(linkList[0].geometry) mapController.lineHandler.showLine(linkList[0].geometry)
Log.e("jingo", "捕捉到的linkId = ${it.linkId}")
} else { } else {
it.linkId = "" it.linkId = ""
mapController.lineHandler.removeLine() mapController.lineHandler.removeLine()
@ -195,6 +201,7 @@ class EvaluationResultViewModel @Inject constructor(
if (liveDataQsRecordBean.value!!.classType.isEmpty()) { if (liveDataQsRecordBean.value!!.classType.isEmpty()) {
Log.e("jingo", "getClassTypeList $classType") Log.e("jingo", "getClassTypeList $classType")
liveDataQsRecordBean.value!!.classType = classType liveDataQsRecordBean.value!!.classType = classType
classTypeTemp = classType
} }
getProblemList(classType) getProblemList(classType)
} }
@ -284,12 +291,14 @@ class EvaluationResultViewModel @Inject constructor(
viewModelScope.launch(Dispatchers.IO) { viewModelScope.launch(Dispatchers.IO) {
getProblemList(classType) getProblemList(classType)
} }
classTypeTemp = classType
} }
/** /**
* 监听右侧栏的点击事件修改数据 * 监听右侧栏的点击事件修改数据
*/ */
fun setPhenomenonMiddleBean(adapterBean: RightBean) { fun setPhenomenonMiddleBean(adapterBean: RightBean) {
liveDataQsRecordBean.value!!.classType = classTypeTemp
liveDataQsRecordBean.value!!.phenomenon = adapterBean.text liveDataQsRecordBean.value!!.phenomenon = adapterBean.text
liveDataQsRecordBean.value!!.problemType = adapterBean.title liveDataQsRecordBean.value!!.problemType = adapterBean.title
liveDataQsRecordBean.postValue(liveDataQsRecordBean.value) liveDataQsRecordBean.postValue(liveDataQsRecordBean.value)
@ -304,7 +313,6 @@ class EvaluationResultViewModel @Inject constructor(
fun saveData() { fun saveData() {
viewModelScope.launch(Dispatchers.IO) { viewModelScope.launch(Dispatchers.IO) {
val realm = Realm.getDefaultInstance() val realm = Realm.getDefaultInstance()
Log.e("jingo", "realm hashCOde ${realm.hashCode()}")
realm.executeTransaction { realm.executeTransaction {
it.copyToRealmOrUpdate(liveDataQsRecordBean.value) it.copyToRealmOrUpdate(liveDataQsRecordBean.value)
} }
@ -385,13 +393,13 @@ class EvaluationResultViewModel @Inject constructor(
fun addChatMsgEntity(filePath: String) { fun addChatMsgEntity(filePath: String) {
if(filePath.isNotEmpty()){ if (filePath.isNotEmpty()) {
var chatMsgEntityList: MutableList<ChatMsgEntity> = ArrayList() var chatMsgEntityList: MutableList<ChatMsgEntity> = ArrayList()
if(listDataChatMsgEntityList.value?.isEmpty() == false){ if (listDataChatMsgEntityList.value?.isEmpty() == false) {
chatMsgEntityList = listDataChatMsgEntityList.value!! chatMsgEntityList = listDataChatMsgEntityList.value!!
} }
val chatMsgEntity = ChatMsgEntity() val chatMsgEntity = ChatMsgEntity()
chatMsgEntity.name = filePath.replace(Constant.USER_DATA_ATTACHEMNT_PATH,"").toString() chatMsgEntity.name = filePath.replace(Constant.USER_DATA_ATTACHEMNT_PATH, "").toString()
chatMsgEntity.voiceUri = Constant.USER_DATA_ATTACHEMNT_PATH chatMsgEntity.voiceUri = Constant.USER_DATA_ATTACHEMNT_PATH
chatMsgEntityList.add(chatMsgEntity) chatMsgEntityList.add(chatMsgEntity)
@ -399,7 +407,7 @@ class EvaluationResultViewModel @Inject constructor(
var attachmentList: RealmList<AttachmentBean> = RealmList() var attachmentList: RealmList<AttachmentBean> = RealmList()
//赋值处理 //赋值处理
if(liveDataQsRecordBean.value?.attachmentBeanList?.isEmpty() == false){ if (liveDataQsRecordBean.value?.attachmentBeanList?.isEmpty() == false) {
attachmentList = liveDataQsRecordBean.value?.attachmentBeanList!! attachmentList = liveDataQsRecordBean.value?.attachmentBeanList!!
} }
@ -415,7 +423,7 @@ class EvaluationResultViewModel @Inject constructor(
fun startSoundMetter(activity: Activity, v: View) { fun startSoundMetter(activity: Activity, v: View) {
if(mSpeakMode==null){ if (mSpeakMode == null) {
mSpeakMode = SpeakMode(activity) mSpeakMode = SpeakMode(activity)
} }
@ -425,7 +433,8 @@ class EvaluationResultViewModel @Inject constructor(
pop!!.width = ViewGroup.LayoutParams.MATCH_PARENT pop!!.width = ViewGroup.LayoutParams.MATCH_PARENT
pop!!.height = ViewGroup.LayoutParams.WRAP_CONTENT pop!!.height = ViewGroup.LayoutParams.WRAP_CONTENT
pop!!.setBackgroundDrawable(BitmapDrawable()) pop!!.setBackgroundDrawable(BitmapDrawable())
val view = View.inflate(activity as Context, R.layout.cv_card_voice_rcd_hint_window, null) val view =
View.inflate(activity as Context, R.layout.cv_card_voice_rcd_hint_window, null)
pop!!.contentView = view pop!!.contentView = view
volume = view.findViewById(R.id.volume) volume = view.findViewById(R.id.volume)
} }

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:color="@color/white" />
<item android:state_pressed="true" android:color="@color/white" />
<item android:state_selected="true" android:color="@color/white" />
<item android:state_checked="true" android:color="@color/white" />
<item android:color="@color/black" />
</selector>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/ripple_color">
<item android:drawable="@drawable/shape_btn_check"/>
</ripple>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:drawable="@drawable/ripple_btn_normal"></item>
<item android:state_checked="true" android:drawable="@drawable/ripple_btn_normal"/>
<item android:state_pressed="true" android:drawable="@drawable/ripple_btn_normal"/>
<item android:state_selected="true" android:drawable="@drawable/ripple_btn_normal"></item>
<item android:drawable="@drawable/ripple_btn_checked"/>
</selector>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/colorSurface"></solid>
<stroke android:color="@color/gray_121" android:width="0.1dp"></stroke>
<corners android:radius="30dp" />
</shape>

View File

@ -4,25 +4,78 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/design_default_color_background" android:background="@color/bg_left_pannel"
tools:context=".ui.fragment.offlinemap.OfflineMapFragment"> tools:context=".ui.fragment.offlinemap.OfflineMapFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/title_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
style="@style/left_pannel_title_layout">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/offline_map_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="5dp"
app:layout_constraintBottom_toBottomOf="parent"
android:background="@drawable/selector_bg_round_button"
android:foreground="@drawable/ripple_btn_press"
style="@style/btn_round"
android:src="@drawable/ic_baseline_keyboard_arrow_left_24"></androidx.appcompat.widget.AppCompatImageView>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/left_pannel_title_font"
android:textStyle="bold"
android:text="离线地图"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"></androidx.appcompat.widget.AppCompatTextView>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/title_layout"
app:layout_constraintBottom_toBottomOf="parent"
style="@style/default_card_view">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingVertical="@dimen/default_widget_padding"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/offline_map_tab_layout" android:id="@+id/offline_map_tab_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/blue" android:background="@color/transparent"
app:tabBackground="@drawable/selector_bg_gradient_checkbox"
app:tabTextColor="@color/black"
app:tabGravity="center"
app:tabPadding="0dp"
app:tabIndicator="@null"
app:tabMode="scrollable"
app:tabIndicatorHeight="0dp"
app:tabSelectedTextColor="@color/white"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toBottomOf="@id/title_layout">
<com.google.android.material.tabs.TabItem <com.google.android.material.tabs.TabItem
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/default_widget_padding"
android:text="下载管理" /> android:text="下载管理" />
<com.google.android.material.tabs.TabItem <com.google.android.material.tabs.TabItem
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/default_widget_padding"
android:text="城市列表" /> android:text="城市列表" />
</com.google.android.material.tabs.TabLayout> </com.google.android.material.tabs.TabLayout>
@ -30,20 +83,9 @@
<androidx.viewpager2.widget.ViewPager2 <androidx.viewpager2.widget.ViewPager2
android:id="@+id/offline_map_viewpager" android:id="@+id/offline_map_viewpager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/offline_map_tab_layout" /> app:layout_constraintTop_toBottomOf="@id/offline_map_tab_layout" />
</LinearLayout>
<ImageView </androidx.cardview.widget.CardView>
android:id="@+id/offline_map_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:padding="10dp"
android:src="@mipmap/icon_back_n"
app:layout_constraintBottom_toBottomOf="@id/offline_map_tab_layout"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@id/offline_map_tab_layout" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -115,6 +115,15 @@
<item name="android:paddingBottom">1dp</item> <item name="android:paddingBottom">1dp</item>
</style> </style>
<style name="checked_gradient_color" parent="TextAppearance.AppCompat.Button">
<item name="android:textColor">@color/selector_default_text_color_black_enable_white</item>
<item name="android:background">@drawable/selector_bg_gradient_checkbox</item>
<item name="android:clickable">true</item>
<item name="android:focusable">true</item>
<item name="android:gravity">center</item>
<item name="android:paddingBottom">1dp</item>
</style>
<style name="fm_btn_default_blue_white" parent="@android:style/Widget.Button"> <style name="fm_btn_default_blue_white" parent="@android:style/Widget.Button">
<item name="android:background">@drawable/selector_bg_blue_gray_bg_4_radius</item> <item name="android:background">@drawable/selector_bg_blue_gray_bg_4_radius</item>
<item name="android:textColor">@color/selector_default_text_color_white_enable_gray</item> <item name="android:textColor">@color/selector_default_text_color_white_enable_gray</item>

View File

@ -591,8 +591,9 @@ public final class NIMapView extends RelativeLayout {
BASE(0)/*底图图层组*/, BASE(0)/*底图图层组*/,
VECTOR_TILE(1)/*矢量瓦片组*/, VECTOR_TILE(1)/*矢量瓦片组*/,
VECTOR(2)/*高亮组*/, VECTOR(2)/*高亮组*/,
OPERATE(3)/*操作图层组*/, OPERATE_LINE(3)/*操作图层组*/,
NAVIGATION(4)/*定位导航组*/; OPERATE_MARKER(4)/*操作图层组*/,
NAVIGATION(5)/*定位导航组*/;
int groupIndex; int groupIndex;

View File

@ -39,6 +39,9 @@ class LineHandler(context: AppCompatActivity, mapView: NIMapView) : BaseHandler(
//绘制线 样式 //绘制线 样式
private val lineStyle: Style private val lineStyle: Style
//高亮线绘制线 样式
private val defaultLineStyle: Style
//线型编辑时的样式 //线型编辑时的样式
private val editTempStyle: Style private val editTempStyle: Style
@ -60,14 +63,16 @@ class LineHandler(context: AppCompatActivity, mapView: NIMapView) : BaseHandler(
private val mDefaultPathLayer: PathLayer private val mDefaultPathLayer: PathLayer
val omdbTaskLinkLayer by lazy { val omdbTaskLinkLayer by lazy {
val omdbTaskLinkLayer = OmdbTaskLinkLayer(mMapView.vtmMap, val omdbTaskLinkLayer = OmdbTaskLinkLayer(
mMapView.vtmMap,
Style.builder() Style.builder()
// .stippleColor(context.resources.getColor(R.color.draw_line_red_color, null)) // .stippleColor(context.resources.getColor(R.color.draw_line_red_color, null))
.fillColor(context.resources.getColor(R.color.draw_line_red_color, null)) .fillColor(context.resources.getColor(R.color.draw_line_red_color, null))
.fillAlpha(0.5f) .fillAlpha(0.5f)
.strokeColor(context.resources.getColor(R.color.draw_line_red_color, null)) .strokeColor(context.resources.getColor(R.color.draw_line_red_color, null))
.strokeWidth(4f) .strokeWidth(4f)
.fixed(true).build()) .fixed(true).build()
)
addLayer(omdbTaskLinkLayer, NIMapView.LAYER_GROUPS.VECTOR) addLayer(omdbTaskLinkLayer, NIMapView.LAYER_GROUPS.VECTOR)
omdbTaskLinkLayer omdbTaskLinkLayer
} }
@ -84,6 +89,15 @@ class LineHandler(context: AppCompatActivity, mapView: NIMapView) : BaseHandler(
.strokeColor(context.resources.getColor(R.color.draw_line_blue2_color, null)) .strokeColor(context.resources.getColor(R.color.draw_line_blue2_color, null))
.fixed(true).build() .fixed(true).build()
defaultLineStyle = Style.builder()
.stippleColor(context.resources.getColor(R.color.draw_line_blue2_color, null))
.strokeWidth(10f)
.fillColor(context.resources.getColor(R.color.teal_200, null))
.fillAlpha(0.5f)
.strokeColor(context.resources.getColor(R.color.teal_200, null))
.fixed(true).build()
newTempStyle = newTempStyle =
Style.builder().stippleColor(context.resources.getColor(R.color.transparent, null)) Style.builder().stippleColor(context.resources.getColor(R.color.transparent, null))
.stipple(30).stippleWidth(30f).strokeWidth(4f) .stipple(30).stippleWidth(30f).strokeWidth(4f)
@ -95,8 +109,8 @@ class LineHandler(context: AppCompatActivity, mapView: NIMapView) : BaseHandler(
.stipple(30).stippleWidth(30f).strokeWidth(8f) .stipple(30).stippleWidth(30f).strokeWidth(8f)
.strokeColor(context.resources.getColor(R.color.draw_line_red_color, null)) .strokeColor(context.resources.getColor(R.color.draw_line_red_color, null))
.fixed(true).randomOffset(false).build() .fixed(true).randomOffset(false).build()
mDefaultPathLayer = PathLayer(mMapView.vtmMap, lineStyle) mDefaultPathLayer = PathLayer(mMapView.vtmMap, defaultLineStyle)
addLayer(mDefaultPathLayer, NIMapView.LAYER_GROUPS.VECTOR) addLayer(mDefaultPathLayer, NIMapView.LAYER_GROUPS.OPERATE_LINE)
mPathLayer = PathLayer(mMapView.vtmMap, lineStyle) mPathLayer = PathLayer(mMapView.vtmMap, lineStyle)
// addLayer(mPathLayer, NIMapView.LAYER_GROUPS.OPERATE) // addLayer(mPathLayer, NIMapView.LAYER_GROUPS.OPERATE)

View File

@ -93,7 +93,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
//初始化之间数据图层 //初始化之间数据图层
initQsRecordDataLayer() initQsRecordDataLayer()
addLayer(mDefaultMarkerLayer, NIMapView.LAYER_GROUPS.OPERATE); addLayer(mDefaultMarkerLayer, NIMapView.LAYER_GROUPS.OPERATE_MARKER);
// 设置矢量图层均在12级以上才显示 // 设置矢量图层均在12级以上才显示
mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition -> mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
if (e == Map.SCALE_EVENT) { if (e == Map.SCALE_EVENT) {
@ -259,7 +259,7 @@ class MarkHandler(context: AppCompatActivity, mapView: NIMapView) :
return true return true
} }
}) })
addLayer(itemizedLayer, NIMapView.LAYER_GROUPS.OPERATE) addLayer(itemizedLayer, NIMapView.LAYER_GROUPS.OPERATE_MARKER)
mContext.lifecycleScope.launch(Dispatchers.IO) { mContext.lifecycleScope.launch(Dispatchers.IO) {
var list = mutableListOf<QsRecordBean>() var list = mutableListOf<QsRecordBean>()
val realm = Realm.getDefaultInstance() val realm = Realm.getDefaultInstance()

View File

@ -116,7 +116,7 @@ open class MeasureLayerHandler(context: AppCompatActivity, mapView: NIMapView) :
mPathLayer = PathLayer(mMapView.vtmMap, lineStyle) mPathLayer = PathLayer(mMapView.vtmMap, lineStyle)
addLayer(mPathLayer, NIMapView.LAYER_GROUPS.OPERATE) addLayer(mPathLayer, NIMapView.LAYER_GROUPS.OPERATE_LINE)
} }