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)