From 024b348fecfe537382660d8185fba6e84cc0878c Mon Sep 17 00:00:00 2001 From: jiangyy Date: Mon, 20 Dec 2021 09:52:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9B=BE=E4=B8=AD=E5=BF=83=E7=82=B9?= =?UTF-8?q?=E9=BB=98=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/visual/basicinfo/basicInfoMain.vue | 8 ++++++-- src/views/modules/visual/components/screen-map/index.vue | 8 ++++++-- src/views/modules/workSys/mapConfig.vue | 7 +++++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/views/modules/visual/basicinfo/basicInfoMain.vue b/src/views/modules/visual/basicinfo/basicInfoMain.vue index 8c0f4a590..568c453b5 100644 --- a/src/views/modules/visual/basicinfo/basicInfoMain.vue +++ b/src/views/modules/visual/basicinfo/basicInfoMain.vue @@ -114,7 +114,7 @@ import BasicInfoCommunity from "./basicInfoCommunity"; import PeopleSearch from "./peopleSearch"; import People from "./people"; import cptCard from "@/views/modules/visual/cpts/card"; - +var centerPointGlobal = [120.38945519, 36.0722275] let loading;//加载动画 @@ -532,11 +532,15 @@ const vueGis = { }, //设置地图定位的中心点和缩放级别 setMapLocation () { - this.centerPoint = [] + if (this.orgData.longitude && this.orgData.latitude) { + this.centerPoint = [] this.centerPoint.push(this.orgData.longitude) this.centerPoint.push(this.orgData.latitude) + } else { + + this.centerPoint = centerPointGlobal } this.setZoom(this.orgData.agencyLevel) diff --git a/src/views/modules/visual/components/screen-map/index.vue b/src/views/modules/visual/components/screen-map/index.vue index eba9be988..0166c8c38 100644 --- a/src/views/modules/visual/components/screen-map/index.vue +++ b/src/views/modules/visual/components/screen-map/index.vue @@ -37,7 +37,7 @@ import { mapGetters } from "vuex"; import { Loading } from 'element-ui'; //引入Loading服务 import { requestPost } from "@/js/dai/request"; - +var centerPointGlobal = [120.38945519, 36.0722275] let loading;//加载动画 @@ -433,11 +433,15 @@ const vueGis = { }, //设置地图定位的中心点和缩放级别 setMapLocation () { - this.centerPoint = [] + if (this.mapInfo.longitude && this.mapInfo.latitude) { + this.centerPoint = [] this.centerPoint.push(this.mapInfo.longitude) this.centerPoint.push(this.mapInfo.latitude) + } else { + + this.centerPoint = centerPointGlobal } this.setZoom(this.mapInfo.level) diff --git a/src/views/modules/workSys/mapConfig.vue b/src/views/modules/workSys/mapConfig.vue index 267b19fc6..5853ab391 100644 --- a/src/views/modules/workSys/mapConfig.vue +++ b/src/views/modules/workSys/mapConfig.vue @@ -67,7 +67,7 @@ import { Loading } from 'element-ui'; //引入Loading服务 import { requestPost } from "@/js/dai/request"; import { altKeyOnly, click, pointerMove } from 'ol/events/condition'; - +var centerPointGlobal = [120.38945519, 36.0722275] let loading;//加载动画 let x = 1500 @@ -374,11 +374,14 @@ const vueGis = { }, //设置地图定位的中心点和缩放级别 setMapLocation () { - this.centerPoint = [] if (this.orgData.longitude && this.orgData.latitude) { + this.centerPoint = [] this.centerPoint.push(this.orgData.longitude) this.centerPoint.push(this.orgData.latitude) + } else { + + this.centerPoint = centerPointGlobal } this.setZoom(this.orgData.agencyLevel)