右侧控制显示面板,同时规整显示隐藏点的逻辑
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useAdministrativeDivision } from '@/hooks/map/useAdministrativeDivision';
|
||||
import { useStatusStore } from '@/stores/useStatusStore';
|
||||
import { useLoadingResourceStore } from '@/stores/useLoadingResourceStore';
|
||||
import { LoadingResource } from '@/types/common/LoadingResourceType';
|
||||
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils';
|
||||
import { Color } from 'cesium';
|
||||
import { onMounted } from 'vue';
|
||||
@@ -42,10 +43,11 @@
|
||||
|
||||
await CesiumUtilsSingleton.batchAddGeoJsonLayers(layerConfigs);
|
||||
|
||||
// 根据状态显示隐藏行政区划
|
||||
if (!useStatusStore().getShowAdministrativeDivision()) {
|
||||
CesiumUtilsSingleton.batchHideGeoJsonLayers(areasId);
|
||||
}
|
||||
// 记录行政区划id
|
||||
useLoadingResourceStore().addLoadingResource(
|
||||
LoadingResource.ADMINISTRATIVE_DIVISION,
|
||||
areasId
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="map_container" id="map-container"></div>
|
||||
|
||||
<!-- 行政区划 -->
|
||||
<AdministrativeDivision v-if="useStatusStore().getAppLoadingCompleted()" />
|
||||
<AdministrativeDivision v-if="useStatusStore().appLoadingCompleted" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
onBeforeMount(() => {
|
||||
// 初始化为false
|
||||
useStatusStore().setAppLoadingCompleted(false);
|
||||
useStatusStore().appLoadingCompleted = false;
|
||||
|
||||
// 重置状态
|
||||
useLoadingInformationStore().resetStatue();
|
||||
@@ -42,7 +42,7 @@
|
||||
});
|
||||
|
||||
// 设置状态
|
||||
useStatusStore().setAppLoadingCompleted(true);
|
||||
useStatusStore().appLoadingCompleted = true;
|
||||
|
||||
// 注册全局点击监听器
|
||||
useMap().registerAndClickOnTheListener();
|
||||
|
||||
Reference in New Issue
Block a user