修改交限渲染

This commit is contained in:
squallzhjch 2023-09-05 14:07:49 +08:00
parent 128c45f90c
commit 1206c0d61c

@ -4,6 +4,7 @@ import android.app.Activity
import android.content.Context import android.content.Context
import android.content.DialogInterface import android.content.DialogInterface
import android.content.SharedPreferences import android.content.SharedPreferences
import android.graphics.Color
import android.graphics.drawable.AnimationDrawable import android.graphics.drawable.AnimationDrawable
import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.BitmapDrawable
import android.os.Build import android.os.Build
@ -609,29 +610,30 @@ class MainViewModel @Inject constructor(
val realm = realmOperateHelper.getRealmDefaultInstance() val realm = realmOperateHelper.getRealmDefaultInstance()
val entity = val entityList =
realmOperateHelper.getRealmTools(RenderEntity::class.java, true) realmOperateHelper.getRealmTools(RenderEntity::class.java, true)
.and() .and()
.equalTo("table", DataCodeEnum.OMDB_RESTRICTION.name) .equalTo("table", DataCodeEnum.OMDB_RESTRICTION.name)
.and() .and()
.equalTo( .equalTo(
"properties['linkIn']", it "properties['linkIn']", it
).findFirst() ).findAll()
if (entity != null) { if (entityList.isNotEmpty()) {
val outLink = entity.properties["linkOut"] val outList = entityList.distinct()
val linkOutEntity = for(i in outList.indices){
realmOperateHelper.getRealmTools(RenderEntity::class.java, true) val outLink = outList[i].properties["linkOut"]
.and() val linkOutEntity =
.equalTo("table", DataCodeEnum.OMDB_RD_LINK.name).and() realmOperateHelper.getRealmTools(RenderEntity::class.java, true)
.equalTo( .equalTo("table", DataCodeEnum.OMDB_RD_LINK.name).and()
"properties['${RenderEntity.Companion.LinkTable.linkPid}']", .equalTo("properties['${RenderEntity.Companion.LinkTable.linkPid}']",outLink
outLink ).findFirst()
).findFirst() if (linkOutEntity != null) {
if (linkOutEntity != null) { mapController.lineHandler.linksLayer.addLine(
mapController.lineHandler.linksLayer.addLine( linkOutEntity.geometry, 0x7DFF0000
linkOutEntity.geometry, 0x7DFF0000 )
) }
} }
mapController.lineHandler.linksLayer.addLine(link.geometry, Color.BLUE)
} }
} }