|
|
@@ -18,18 +18,22 @@
|
|
|
<!-- 地图图例 -->
|
|
|
<!-- <map-legend></map-legend> -->
|
|
|
<land-use-legend @change="handleLegendChange"></land-use-legend>
|
|
|
+ <div class="show-point yes-events" v-show="showPoint" @click="handleShowPointClick"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div ref="mapRef" class="bottom-map"></div>
|
|
|
+ <track-dialog></track-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import "./map/mockFarmLayer";
|
|
|
import StaticMapLayers from "@/components/static_map_change/Layers.js";
|
|
|
-import { onMounted, onUnmounted, ref, reactive, nextTick } from "vue";
|
|
|
+import StaticMapPointLayers from "@/components/static_map_change/pointLayer.js"
|
|
|
+import { onMounted, onUnmounted, ref, nextTick } from "vue";
|
|
|
import fnHeader from "@/components/fnHeader.vue";
|
|
|
import landUseLegend from "./components/landUseLegend.vue";
|
|
|
import WarningMap from "./warningMap";
|
|
|
+import trackDialog from "./components/trackDialog.vue";
|
|
|
import AlarmLayer from "./map/alarmLayer";
|
|
|
import DistributionLayer from "./map/distributionLayer";
|
|
|
import BoundaryLayer from "./map/boundaryLayer";
|
|
|
@@ -44,6 +48,7 @@ let warningMap = new WarningMap();
|
|
|
let alarmLayer = null;
|
|
|
let staticMapLayers = null;
|
|
|
let distributionLayer = null;
|
|
|
+let staticMapPointLayers = null;
|
|
|
let boundaryLayer = null;
|
|
|
const mapRef = ref(null);
|
|
|
const treeRef = ref(null);
|
|
|
@@ -66,15 +71,26 @@ const baseTabs = ["物候期分布", "长势等级", "水利", "灌渠与泵站"
|
|
|
const activeBaseTab = ref("物候期分布");
|
|
|
|
|
|
const warningLayers = ref({});
|
|
|
-
|
|
|
+const showPoint = ref(false)
|
|
|
const handleBaseTabClick = (tab) => {
|
|
|
activeBaseTab.value = tab;
|
|
|
+ showPoint.value = false
|
|
|
+ staticMapPointLayers.hidePoint()
|
|
|
+ if (tab === "资源") {
|
|
|
+ staticMapPointLayers.showPoint()
|
|
|
+ }else if (tab === "灌渠与泵站") {
|
|
|
+ showPoint.value = true
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const handleSmartFarmClick = () => {
|
|
|
window.open("https://feiniao-pc-gly.feiniaotech.com/#/login");
|
|
|
};
|
|
|
|
|
|
+const handleShowPointClick = () => {
|
|
|
+ eventBus.emit("chat:showTrackDialog")
|
|
|
+}
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
// 使用 nextTick 确保 DOM 已经渲染完成,地图容器有正确的尺寸
|
|
|
await nextTick();
|
|
|
@@ -91,6 +107,7 @@ onMounted(async () => {
|
|
|
|
|
|
alarmLayer = new AlarmLayer(warningMap.kmap);
|
|
|
staticMapLayers = new StaticMapLayers(warningMap.kmap);
|
|
|
+ staticMapPointLayers = new StaticMapPointLayers(warningMap.kmap);
|
|
|
distributionLayer = new DistributionLayer(warningMap.kmap);
|
|
|
boundaryLayer = new BoundaryLayer(warningMap.kmap);
|
|
|
await getSpeciesListData();
|
|
|
@@ -177,8 +194,6 @@ onMounted(async () => {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- // 初始化区域选择器的默认值
|
|
|
- // initAreaDefaultValue();
|
|
|
|
|
|
// 窗口大小改变时更新地图尺寸
|
|
|
const handleResize = () => {
|
|
|
@@ -494,6 +509,16 @@ const handleLegendChange = (data) => {
|
|
|
box-sizing: border-box;
|
|
|
position: relative;
|
|
|
|
|
|
+ .show-point{
|
|
|
+ position: absolute;
|
|
|
+ top: calc(50% - 250px);
|
|
|
+ left: calc(50% - 250px);
|
|
|
+ width: 500px;
|
|
|
+ height: 500px;
|
|
|
+ // background: red;
|
|
|
+ z-index: 2;
|
|
|
+ }
|
|
|
+
|
|
|
.left,
|
|
|
.right {
|
|
|
width: calc(376px + 54px);
|