|
|
@ -22,11 +22,11 @@ |
|
|
|
type="primary" |
|
|
|
icon="el-icon-edit" |
|
|
|
@click="handleEditPolygon">{{method==='mEditPolygon'?'取消绘制':'重新绘制'}}</el-button> |
|
|
|
<el-button v-if="showBtn&&hasPolygon" |
|
|
|
<!-- <el-button v-if="showBtn&&hasPolygon" |
|
|
|
style="margin-left:10px" |
|
|
|
type="primary" |
|
|
|
icon="el-icon-delete" |
|
|
|
@click="handleDelPolygon">删除区域</el-button> |
|
|
|
@click="handleDelPolygon">删除区域</el-button> --> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="div_back"> |
|
|
@ -47,9 +47,6 @@ |
|
|
|
<script> |
|
|
|
import 'ol/ol.css' |
|
|
|
import { Map, View } from 'ol' |
|
|
|
import { ZoomSlider, Zoom } from 'ol/control.js'; |
|
|
|
import ImageLayer from 'ol/layer/Image.js'; |
|
|
|
import Static from 'ol/source/ImageStatic.js'; |
|
|
|
import TileLayer from 'ol/layer/Tile.js'; |
|
|
|
import XYZ from 'ol/source/XYZ.js'; |
|
|
|
import VectorLayer from 'ol/layer/Vector.js'; |
|
|
@ -64,7 +61,6 @@ import Draw from 'ol/interaction/Draw.js'; |
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
import { Loading } from 'element-ui'; //引入Loading服务 |
|
|
|
import { requestPost } from "@/js/dai/request"; |
|
|
|
import { transform } from 'ol/proj' |
|
|
|
import { altKeyOnly, click, pointerMove } from 'ol/events/condition'; |
|
|
|
|
|
|
|
|
|
|
@ -192,7 +188,7 @@ const vueGis = { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//刷新地图 |
|
|
|
//刷新地图 isRefreshView:是否需要重置中心点,如果是绘制、删除区域,不需要,如果是下钻或返回需要 |
|
|
|
async refreshMap (isRefreshView) { |
|
|
|
//加载组织数据 |
|
|
|
await this.loadOrgData() |
|
|
@ -326,7 +322,9 @@ const vueGis = { |
|
|
|
|
|
|
|
//选择feature |
|
|
|
selectFeature (e) { |
|
|
|
console.log(e) |
|
|
|
// console.log(e) |
|
|
|
|
|
|
|
if (this.method === undefined || this.method === '') { |
|
|
|
this.selAgencyId = e.selected[0].id_ |
|
|
|
this.subAgencyArray.forEach((element, index) => { |
|
|
|
if (element.id === e.selected[0].id_) { |
|
|
@ -335,11 +333,13 @@ const vueGis = { |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
//下钻到下一级 |
|
|
|
toSubAgency (e) { |
|
|
|
console.log(e) |
|
|
|
|
|
|
|
if (this.method != 'mAddPolygon' && this.level != 'neighborHood') { |
|
|
|
//下钻到下一级 |
|
|
|
this.subAgencyArray.forEach(item => { |
|
|
@ -580,6 +580,7 @@ const vueGis = { |
|
|
|
type: "Polygon" |
|
|
|
}); |
|
|
|
map.addInteraction(draw); |
|
|
|
|
|
|
|
draw.on('drawend', feature => { |
|
|
|
this.polygonCoor = feature.feature.values_.geometry.flatCoordinates |
|
|
|
|
|
|
@ -590,10 +591,28 @@ const vueGis = { |
|
|
|
if (this.polygonCoor.length > 0) { |
|
|
|
coorString = coorString.substring(0, coorString.length - 1) |
|
|
|
} |
|
|
|
console.log(coorString) |
|
|
|
|
|
|
|
if (this.method === 'mEditPolygon') { |
|
|
|
this.$confirm("是否确认覆盖原有区域?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
this.addPolygon(coorString) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
this.loadPolygon(this.subAgencyArray) |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
this.addPolygon(coorString) |
|
|
|
} |
|
|
|
|
|
|
|
this.method = "" |
|
|
|
map.removeInteraction(draw); |
|
|
|
this.addPolygon(coorString) |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
@ -625,6 +644,7 @@ const vueGis = { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//删除标注 |
|
|
|
async delPolygon () { |
|
|
|
const url = "/gov/org/agency/mapdelarea" |
|
|
|