修改测量工具的联动功能
修改崩溃bug
This commit is contained in:
parent
6bed16f470
commit
54b30d5db5
@ -503,7 +503,7 @@ class MainActivity : BaseActivity() {
|
||||
/**
|
||||
* 结束测量
|
||||
*/
|
||||
private fun measuringToolOff() {
|
||||
fun measuringToolOff() {
|
||||
//监听测距值
|
||||
mapController.measureLayerHandler.measureValueLiveData.removeObservers(this)
|
||||
mapController.measureLayerHandler.tempMeasureValueLiveData.removeObservers(this)
|
||||
|
@ -97,7 +97,7 @@ class TaskLinkFragment : BaseFragment(), View.OnClickListener {
|
||||
* 线长度
|
||||
*/
|
||||
mapController.measureLayerHandler.measureValueLiveData.observe(viewLifecycleOwner) {
|
||||
binding.taskLinkLength.text = "${it}米"
|
||||
binding.taskLinkLength.text = "${it.valueString}${it.unit}"
|
||||
}
|
||||
mapController.measureLayerHandler.tempMeasureValueLiveData.observe(viewLifecycleOwner) {
|
||||
(activity as MainActivity).setHomeCenterText("${it.valueString}${it.unit}")
|
||||
@ -110,6 +110,7 @@ class TaskLinkFragment : BaseFragment(), View.OnClickListener {
|
||||
* 显示地图准星
|
||||
*/
|
||||
activity?.let {
|
||||
(activity as MainActivity).measuringToolOff()
|
||||
(activity as MainActivity).setHomeCenterVisibility(View.VISIBLE)
|
||||
}
|
||||
}
|
||||
|
@ -296,9 +296,11 @@ class TaskLinkViewModel @Inject constructor(
|
||||
if (task != null) {
|
||||
liveDataTaskBean.postValue(realm.copyFromRealm(task))
|
||||
}
|
||||
hadLinkDvoBean = realm.copyFromRealm(objects)
|
||||
withContext(Dispatchers.Main) {
|
||||
mapController.measureLayerHandler.initPathLine(hadLinkDvoBean?.geometry!!)
|
||||
if(objects != null) {
|
||||
hadLinkDvoBean = realm.copyFromRealm(objects)
|
||||
withContext(Dispatchers.Main) {
|
||||
mapController.measureLayerHandler.initPathLine(hadLinkDvoBean?.geometry!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,6 @@ public class OMDBReferenceDataSource implements ITileDataSource {
|
||||
if (!listResult.isEmpty()) {
|
||||
mThreadLocalDecoders.get().decode(tile.zoomLevel, tile, mapDataSink, listResult);
|
||||
}
|
||||
Log.e("jingo",listResult.size() + "条数据");
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
// Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
} else {
|
||||
|
@ -50,12 +50,9 @@ public class OMDBTileDataSource implements ITileDataSource {
|
||||
}
|
||||
List<RenderEntity> listResult = realmQuery/*.distinct("id")*/.findAll();
|
||||
if (!listResult.isEmpty()) {
|
||||
Log.e("qj", "查询数据==" + listResult.size() + "==地图级别" + tile.zoomLevel);
|
||||
mThreadLocalDecoders.get().decode(tile.zoomLevel, tile, mapDataSink, listResult);
|
||||
}
|
||||
Log.e("jingo",listResult.size() + "条数据 主");
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
// Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
} else {
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user