修改数据上传

This commit is contained in:
squallzhjch 2023-05-05 15:14:20 +08:00
parent 611385c145
commit d3fd50f941
3 changed files with 36 additions and 18 deletions

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 (this!=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

@ -171,6 +171,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()
@ -424,7 +425,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

@ -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)
mPathLayer = PathLayer(mMapView.vtmMap, lineStyle) mPathLayer = PathLayer(mMapView.vtmMap, lineStyle)
// addLayer(mPathLayer, NIMapView.LAYER_GROUPS.OPERATE) // addLayer(mPathLayer, NIMapView.LAYER_GROUPS.OPERATE)