From 58c3ad62c39972aa977728808777b205a40e9786 Mon Sep 17 00:00:00 2001 From: xiaoyan Date: Tue, 25 Apr 2023 15:36:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../omqs/ui/activity/login/LoginViewModel.kt | 3 +- .../personalcenter/PersonalCenterFragment.kt | 5 +- .../src/main/assets/editormarker.xml | 99 ++++- .../src/main/assets/omdb/oneway_left.svg | 11 + .../src/main/assets/omdb/oneway_right.svg | 11 + .../map/handler/LayerManagerHandler.kt | 12 + .../src/main/res/resources/rendertheme.xsd | 367 ++++++++++++++++++ 7 files changed, 503 insertions(+), 5 deletions(-) create mode 100644 collect-library/src/main/assets/omdb/oneway_left.svg create mode 100644 collect-library/src/main/assets/omdb/oneway_right.svg create mode 100644 collect-library/src/main/res/resources/rendertheme.xsd diff --git a/app/src/main/java/com/navinfo/omqs/ui/activity/login/LoginViewModel.kt b/app/src/main/java/com/navinfo/omqs/ui/activity/login/LoginViewModel.kt index e241cb99..b8176184 100644 --- a/app/src/main/java/com/navinfo/omqs/ui/activity/login/LoginViewModel.kt +++ b/app/src/main/java/com/navinfo/omqs/ui/activity/login/LoginViewModel.kt @@ -159,7 +159,8 @@ class LoginViewModel @Inject constructor( Constant.VERSION_ID = userId Constant.USER_DATA_PATH = Constant.DATA_PATH + Constant.USER_ID + "/" + Constant.VERSION_ID // 在SD卡创建用户目录,解压资源等 - val userFolder = File("${Constant.DATA_PATH}/${userId}") + val userFolder = File(Constant.USER_DATA_PATH) + if (!userFolder.exists()) userFolder.mkdirs() // 初始化Realm Realm.init(context.applicationContext) val password = "encryp".encodeToByteArray().copyInto(ByteArray(64)) diff --git a/app/src/main/java/com/navinfo/omqs/ui/fragment/personalcenter/PersonalCenterFragment.kt b/app/src/main/java/com/navinfo/omqs/ui/fragment/personalcenter/PersonalCenterFragment.kt index 012f2b71..35d96e52 100644 --- a/app/src/main/java/com/navinfo/omqs/ui/fragment/personalcenter/PersonalCenterFragment.kt +++ b/app/src/main/java/com/navinfo/omqs/ui/fragment/personalcenter/PersonalCenterFragment.kt @@ -98,7 +98,8 @@ class PersonalCenterFragment : BaseFragment(), FSAFActivityCallbacks { override fun onResult(uri: Uri) { val file = UriUtils.uri2File(uri) - val importOMDBHelper: ImportOMDBHelper = importOMDBHiltFactory.obtainImportOMDBHelper( + val importOMDBHelper: ImportOMDBHelper = + importOMDBHiltFactory.obtainImportOMDBHelper( requireContext(), file ) @@ -120,7 +121,7 @@ class PersonalCenterFragment : BaseFragment(), FSAFActivityCallbacks { R.id.personal_center_menu_test -> { viewModel.readRealmData() // 定位到指定位置 - niMapController.mMapView.vtmMap.animator().animateTo(GeoPoint(30.21137798479949, 113.84832672274896)) + niMapController.mMapView.vtmMap.animator().animateTo(GeoPoint(30.270367985798032, 113.83513667119433)) } R.id.personal_center_menu_task_list -> { findNavController().navigate(R.id.TaskListFragment) diff --git a/collect-library/src/main/assets/editormarker.xml b/collect-library/src/main/assets/editormarker.xml index d0ad69e1..aa009d1b 100644 --- a/collect-library/src/main/assets/editormarker.xml +++ b/collect-library/src/main/assets/editormarker.xml @@ -1550,8 +1550,103 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/collect-library/src/main/assets/omdb/oneway_left.svg b/collect-library/src/main/assets/omdb/oneway_left.svg new file mode 100644 index 00000000..9acd8dbe --- /dev/null +++ b/collect-library/src/main/assets/omdb/oneway_left.svg @@ -0,0 +1,11 @@ + + + + + Layer 1 + + + + + + \ No newline at end of file diff --git a/collect-library/src/main/assets/omdb/oneway_right.svg b/collect-library/src/main/assets/omdb/oneway_right.svg new file mode 100644 index 00000000..b289a043 --- /dev/null +++ b/collect-library/src/main/assets/omdb/oneway_right.svg @@ -0,0 +1,11 @@ + + + + + Layer 1 + + + + + + \ No newline at end of file diff --git a/collect-library/src/main/java/com/navinfo/collect/library/map/handler/LayerManagerHandler.kt b/collect-library/src/main/java/com/navinfo/collect/library/map/handler/LayerManagerHandler.kt index 3b419ed5..f3524706 100644 --- a/collect-library/src/main/java/com/navinfo/collect/library/map/handler/LayerManagerHandler.kt +++ b/collect-library/src/main/java/com/navinfo/collect/library/map/handler/LayerManagerHandler.kt @@ -116,6 +116,18 @@ open class LayerManagerHandler(context: AppCompatActivity, mapView: NIMapView,tr mMapView.updateMap() // initMapLifeSource() + // 设置矢量图层均在12级以上才显示 + mMapView.vtmMap.events.bind(UpdateListener { e, mapPosition -> + if (e == org.oscim.map.Map.SCALE_EVENT) { + // 测评数据图层在指定Zoom后开始显示 + val isOmdbZoom = mapPosition.zoomLevel>=Constant.OMDB_MIN_ZOOM + baseGroupLayer?.layers?.forEach { + it.isEnabled = !isOmdbZoom + } + omdbVectorTileLayer.isEnabled = isOmdbZoom + omdbLabelLayer.isEnabled = isOmdbZoom + } + }) } private fun initOMDBVectorTileLayer() { diff --git a/collect-library/src/main/res/resources/rendertheme.xsd b/collect-library/src/main/res/resources/rendertheme.xsd new file mode 100644 index 00000000..b28e722a --- /dev/null +++ b/collect-library/src/main/res/resources/rendertheme.xsd @@ -0,0 +1,367 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +