新增store管理
This commit is contained in:
parent
10e9ecc4a7
commit
490ff6d1ac
|
@ -35,19 +35,19 @@ const usePermissionStore = defineStore(
|
|||
},
|
||||
generateRoutes(roles) {
|
||||
return new Promise(resolve => {
|
||||
let menu = JSON.parse(Cookies.get('menu')||'{}')
|
||||
if(!menu.menuId){
|
||||
let menu = JSON.parse(Cookies.get('menu')||sessionStorage.getItem("menu")||'{}')
|
||||
if(!menu?.menuId){
|
||||
return
|
||||
}
|
||||
Cookies.remove("menu")
|
||||
sessionStorage.setItem('menu',JSON.stringify(menu));
|
||||
// 向后端请求路由数据
|
||||
getRouters({menuId:menu.menuId}).then(res => {
|
||||
|
||||
res.data.forEach(data=>{
|
||||
if(!isHttp(data.path) ){
|
||||
data.path = '/'+data.path
|
||||
data.component = "Layout"
|
||||
}
|
||||
|
||||
})
|
||||
const sdata = JSON.parse(JSON.stringify(res.data))
|
||||
const rdata = JSON.parse(JSON.stringify(res.data))
|
||||
|
|
|
@ -23,7 +23,7 @@ const userStore = useUserStore()
|
|||
import {getDesktopRouters} from '@index/api/menu'
|
||||
const {proxy} = getCurrentInstance();
|
||||
const openMenu =(item)=>{
|
||||
|
||||
debugger
|
||||
if(item.path){
|
||||
|
||||
if(isHttp(item.path)){
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="楼层:" prop="houseFloors">
|
||||
<el-input v-model="form.houseFloors" type="number" placeholder="请输入" class="inputCss" />
|
||||
<label for="" style="color: #fff;">({{maxHouseFloors}}~{{minHouseFloors}})</label>
|
||||
<!-- <label for="" style="color: #fff;">({{maxHouseFloors}}~{{minHouseFloors}})</label> -->
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="面积:" prop="area">
|
||||
|
@ -121,33 +121,9 @@ const rules=ref( {
|
|||
])
|
||||
const maxHouseFloors = ref('')
|
||||
const minHouseFloors = ref('')
|
||||
onMounted(() => {
|
||||
|
||||
let lineId = form.value.geometryId
|
||||
let graphics =ldMap.sketchLayer.polygonLayer.sublayers.items
|
||||
let garphic = graphics.filter(element => {
|
||||
return element.id == lineId
|
||||
})[0];
|
||||
let center = [[garphic.geometry.centroid.x,garphic.geometry.centroid.y]]
|
||||
getElevation({
|
||||
layersId:props.layerId,
|
||||
geoJsonData:[...center,...garphic.geometry.rings[0]]
|
||||
}).then(res=>{
|
||||
|
||||
|
||||
|
||||
const [maxNumber, minNumber] = getMaxAndMin(res.data);
|
||||
maxHouseFloors.value=maxNumber
|
||||
minHouseFloors.value=minNumber
|
||||
console.log(`最大数: ${maxNumber}`);
|
||||
console.log(`最小数: ${minNumber}`);
|
||||
console.log(`楼层差: ${maxNumber}-${minNumber}`+(maxNumber-minNumber));
|
||||
form.value.houseFloors= parseInt( (maxNumber-minNumber)/3)
|
||||
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
function getMaxAndMin(numbers) {
|
||||
const max = Math.max(...numbers);
|
||||
const min = Math.min(...numbers);
|
||||
|
|
|
@ -365,14 +365,15 @@ onMounted(() => {
|
|||
treeHeight.value = window.innerHeight - 258;
|
||||
};
|
||||
tableDate.value = house.value;
|
||||
$ldMap.initMap().then((e) => {
|
||||
getLayerList().then(() => {
|
||||
if (layerslist.value) {
|
||||
selectLayer(layerslist.value[0].id);
|
||||
}
|
||||
});
|
||||
let firstData =layerslist.value[0]
|
||||
selectLayer(firstData.id);
|
||||
getlegend();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
emitter.on("loadLayer", () => {
|
||||
getLayerList();
|
||||
});
|
||||
|
@ -483,10 +484,16 @@ function selectLayer(e) {
|
|||
console.log(item);
|
||||
layerId.value = item.id;
|
||||
layerName.value = item.layerName
|
||||
$ldMap.initMap(item.coordinateSystem.epsg).then((e) => {
|
||||
|
||||
$ldMap.addLayer({
|
||||
url: item.layerUrl,
|
||||
id: e,
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -421,9 +421,7 @@ function addPointMap(val) {
|
|||
$ldMap.addDefaultByPoint(data);
|
||||
});
|
||||
}
|
||||
function getAllMapData() {
|
||||
$ldMap.getAllData();
|
||||
}
|
||||
|
||||
function cutPolygon() {
|
||||
let { flag, data } = cut();
|
||||
if (flag) {
|
||||
|
@ -571,11 +569,12 @@ function setPolygonData() {
|
|||
$ldMap.addDeviceData(mapdata.station, "Station");
|
||||
});
|
||||
}
|
||||
|
||||
function exportCad(){
|
||||
// exporGis()
|
||||
if(profilesId.value){
|
||||
proxy.download("/pipe/recognition/exportCad?profilesId="+profilesId.value, {},
|
||||
`${layerName.value}.dxf`,{
|
||||
`${layerName.value}.dwg`,{
|
||||
baseURL: "/map-api"
|
||||
},true);
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
v-model="findValue"
|
||||
style="background: rgb(0, 0, 0, 0.4)"
|
||||
:close-on-click-modal="false"
|
||||
:before-close="closeWaitDialog"
|
||||
width="30%"
|
||||
>
|
||||
<template #header="{ close, titleId, titleClass }">
|
||||
|
@ -135,10 +136,7 @@
|
|||
>
|
||||
<el-button
|
||||
type="warning"
|
||||
@click="
|
||||
findValue = false;
|
||||
loading = false;
|
||||
"
|
||||
@click="closeBtn"
|
||||
>取消</el-button
|
||||
>
|
||||
</div>
|
||||
|
@ -148,6 +146,7 @@
|
|||
v-model="lineValue"
|
||||
title=""
|
||||
:close-on-click-modal="false"
|
||||
:before-close="closeWaitDialog"
|
||||
width="30%"
|
||||
>
|
||||
<template #header="{ close, titleId, titleClass }">
|
||||
|
@ -253,10 +252,7 @@
|
|||
>
|
||||
<el-button
|
||||
type="warning"
|
||||
@click="
|
||||
lineValue = false;
|
||||
loading = false;
|
||||
"
|
||||
@click="closeBtn"
|
||||
>取消</el-button
|
||||
>
|
||||
</div>
|
||||
|
@ -407,6 +403,7 @@ import html2canvas from "html2canvas";
|
|||
import { ElMessage } from "element-plus";
|
||||
const $ldMap = inject("$ldMap"); // 调用全局变量
|
||||
const $ldBox = inject("$ldBox"); // 调用全局变量
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
const componentId = ref(sjLeft);
|
||||
const comid = ref("sj");
|
||||
const changemenu = (e) => {
|
||||
|
@ -439,10 +436,13 @@ const posterimg = ref();
|
|||
|
||||
let mapdata = useMapDataStore();
|
||||
let mapLog = useMapLogStore();
|
||||
const { sseData, profilesList, secen } = storeToRefs(mapdata);
|
||||
const { sseData, profilesList, secen,clientId } = storeToRefs(mapdata);
|
||||
|
||||
const setFlag = ref(false);
|
||||
const priceRef = ref();
|
||||
watch(clientId,(val)=>{
|
||||
loading.value=Boolean(val)
|
||||
})
|
||||
watch(setFlag, (val) => {
|
||||
!val && priceRef.value.init();
|
||||
});
|
||||
|
@ -523,9 +523,6 @@ const verificationChange = () => {
|
|||
const findValue = ref<Boolean>(false);
|
||||
const lineValue = ref<Boolean>(false);
|
||||
const loading = ref(false);
|
||||
watch([lineValue, findValue], (val) => {
|
||||
!val[0] && !val[1] && (loading.value = false);
|
||||
});
|
||||
const setFindVal = (e) => {
|
||||
mapdata.getProfilesList().then((res) => {
|
||||
findValue.value = e;
|
||||
|
@ -541,7 +538,7 @@ const setLineVal = (e) => {
|
|||
|
||||
const current = ref("");
|
||||
const handleCurrentChange = (e) => {
|
||||
current.value = e.id;
|
||||
e&&(current.value = e.id)
|
||||
};
|
||||
const profilesDelete = (e) => {
|
||||
mapdata
|
||||
|
@ -552,10 +549,38 @@ const profilesDelete = (e) => {
|
|||
})
|
||||
.catch((e) => {});
|
||||
};
|
||||
function closeBtn(){
|
||||
closeWaitDialog(()=>{
|
||||
|
||||
lineValue.value=false;
|
||||
findValue.value = false;
|
||||
loading.value = false;
|
||||
})
|
||||
}
|
||||
function closeWaitDialog(fun){
|
||||
|
||||
console.log(clientId.value)
|
||||
if(clientId.value){
|
||||
ElMessageBox.confirm("数据加载中,是否确定关闭", {
|
||||
confirmButtonText: "关闭",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
mapdata.closeSse();
|
||||
fun();
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
});
|
||||
}else{
|
||||
fun();
|
||||
}
|
||||
}
|
||||
const priceFlag = ref(false);
|
||||
function findArea(override) {
|
||||
loading.value = true;
|
||||
// loading.value = true;
|
||||
$ldMap.removeAllLayer();
|
||||
if (override) {
|
||||
mapdata
|
||||
|
@ -563,8 +588,9 @@ function findArea(override) {
|
|||
.then(() => {
|
||||
setValue();
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
.catch((e) => {
|
||||
|
||||
|
||||
});
|
||||
} else {
|
||||
if (current.value) {
|
||||
|
@ -587,6 +613,7 @@ function findArea(override) {
|
|||
actionType: "data", //add,exit,del,
|
||||
isrevoke: false, //是否允许撤回,
|
||||
});
|
||||
$ldMap.removeAllLayer();
|
||||
$ldMap.addDefaultData(mapdata.road, "Road");
|
||||
$ldMap.addDefaultData(mapdata.house, "House");
|
||||
$ldMap.addDefaultData(mapdata.river, "River");
|
||||
|
@ -595,7 +622,7 @@ function findArea(override) {
|
|||
}
|
||||
}
|
||||
function findLine(override) {
|
||||
loading.value = true;
|
||||
// loading.value = true;
|
||||
if(override){
|
||||
mapdata
|
||||
.setLineData(override)
|
||||
|
@ -603,7 +630,7 @@ function findLine(override) {
|
|||
setLine()
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
// loading.value = false;
|
||||
});
|
||||
|
||||
}else{
|
||||
|
|
|
@ -24,6 +24,7 @@ const useMapDataStore = defineStore(
|
|||
'mapData',
|
||||
{
|
||||
state: () => ({
|
||||
source:null,
|
||||
profilesList: [],
|
||||
profilesId: '',
|
||||
layerId: '',
|
||||
|
@ -117,7 +118,7 @@ const useMapDataStore = defineStore(
|
|||
|
||||
resolve()
|
||||
}).catch(err => {
|
||||
reject()
|
||||
reject(err)
|
||||
})
|
||||
} else {
|
||||
recognitionload({ layersId: this.layerId, override }).then(res => {
|
||||
|
@ -252,16 +253,27 @@ const useMapDataStore = defineStore(
|
|||
});
|
||||
this.house = houseData;
|
||||
},
|
||||
closeSse(){
|
||||
let self = this;
|
||||
sseClose(self.clientId).then(res=>{
|
||||
self.clientId = ''
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
sseConfig(type) {
|
||||
let self = this;
|
||||
self.sseData = []
|
||||
self.clientId = ''
|
||||
if(self.clientId){
|
||||
this.closeSse()
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
let base = '/map-api';
|
||||
let url = `${base}/sse/connect/`;
|
||||
|
||||
var es = new EventSourcePolyfill(url, {
|
||||
self.source = new EventSourcePolyfill(url, {
|
||||
heartbeatTimeout: 10000000,
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + getToken()
|
||||
|
@ -269,12 +281,12 @@ const useMapDataStore = defineStore(
|
|||
|
||||
});
|
||||
|
||||
es.onopen = function (event) {
|
||||
self.source.onopen = function (event) {
|
||||
console.log("连接成功", event);
|
||||
|
||||
};
|
||||
|
||||
es.onmessage = function (event) {
|
||||
self.source.onmessage = function (event) {
|
||||
// to to something…
|
||||
console.log("接收信息", event);
|
||||
// console.log(event.data)
|
||||
|
@ -284,14 +296,19 @@ const useMapDataStore = defineStore(
|
|||
case 'clientId': setRecogn(data.data); break;
|
||||
case 'text': self.sseData.push(data); break;
|
||||
case 'data': setdata(data.data); break;
|
||||
|
||||
case 'error': errordata(data.data); break;
|
||||
}
|
||||
};
|
||||
function setRecogn(clientId) {
|
||||
if (!self.clientId) {
|
||||
self.clientId = clientId
|
||||
if (type == 'recognition') {
|
||||
recognitionreload({ layersId: self.layerId, clientId })
|
||||
recognitionreload({ layersId: self.layerId, clientId }).then(res=>{
|
||||
|
||||
}).catch(err => {
|
||||
|
||||
self.closeSse()
|
||||
})
|
||||
|
||||
} else {
|
||||
pipelinereload({ layersId: self.layerId, clientId })
|
||||
|
@ -304,9 +321,7 @@ const useMapDataStore = defineStore(
|
|||
let text = (type == 'recognition' ? '特征物识别' : '布线') + '结束,关闭并刷新?点击确定刷新,点击取消停留当前页面'
|
||||
ElMessageBox.confirm(text, '识别提示',
|
||||
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
||||
|
||||
self.clientId = ''
|
||||
es.close()
|
||||
self.closeSse()
|
||||
resolve(data)
|
||||
|
||||
}).catch(() => {
|
||||
|
@ -314,12 +329,18 @@ const useMapDataStore = defineStore(
|
|||
reject()
|
||||
});
|
||||
}
|
||||
function errordata(text){
|
||||
ElMessageBox.confirm(text, '错误提示',
|
||||
{ confirmButtonText: '关闭',showCancelButton:false, type: 'warning' }).then(() => {
|
||||
self.clientId=''
|
||||
});
|
||||
|
||||
es.onerror = function (error) {
|
||||
}
|
||||
|
||||
self.source = function (error) {
|
||||
// 监听错误
|
||||
console.log("错误", error);
|
||||
self.clientId = ''
|
||||
es.close()
|
||||
// reject()
|
||||
};
|
||||
});
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
const tk="0eab750b26cdeee155e8c4f2310b53ef"
|
||||
const TileInfoData={
|
||||
infoData:{
|
||||
infoData:function (wkid:number){
|
||||
let data = {
|
||||
'4326':{
|
||||
dpi: 90.71428571427429, // 切片方案的每英寸点数(即像素)。
|
||||
size: 256, // 设置每个瓷砖的高度和宽度为[256, 256]像素。
|
||||
origin: {
|
||||
|
@ -8,9 +10,9 @@ const TileInfoData={
|
|||
type: "point",
|
||||
x: -180,
|
||||
y: 90,
|
||||
spatialReference: { wkid: 4326 },
|
||||
spatialReference: { wkid: wkid },
|
||||
},
|
||||
spatialReference: { wkid: 4326 },
|
||||
spatialReference: { wkid: wkid },
|
||||
lods: [
|
||||
// 定义平铺方案的详细级别数组。
|
||||
{
|
||||
|
@ -122,7 +124,145 @@ const TileInfoData={
|
|||
scale: 1127.23386023998275,
|
||||
},
|
||||
],
|
||||
},
|
||||
'4490':{
|
||||
dpi: 96,
|
||||
rows: 256,
|
||||
cols: 256,
|
||||
compressionQuality: 0,
|
||||
origin: {
|
||||
x: -180,
|
||||
y: 90
|
||||
},
|
||||
spatialReference: {
|
||||
wkid: 4490
|
||||
},
|
||||
lods: [
|
||||
{
|
||||
level: 1,
|
||||
levelValue: 1,
|
||||
resolution: 0.703125,
|
||||
scale: 295497593.05875003
|
||||
},
|
||||
{
|
||||
level: 2,
|
||||
levelValue: 2,
|
||||
resolution: 0.3515625,
|
||||
scale: 147748796.52937502
|
||||
},
|
||||
{
|
||||
level: 3,
|
||||
levelValue: 3,
|
||||
resolution: 0.17578125,
|
||||
scale: 73874398.264687508
|
||||
},
|
||||
{
|
||||
level: 4,
|
||||
levelValue: 4,
|
||||
resolution: 0.087890625,
|
||||
scale: 36937199.132343754
|
||||
},
|
||||
{
|
||||
level: 5,
|
||||
levelValue: 5,
|
||||
resolution: 0.0439453125,
|
||||
scale: 18468599.566171877
|
||||
},
|
||||
{
|
||||
level: 6,
|
||||
levelValue: 6,
|
||||
resolution: 0.02197265625,
|
||||
scale: 9234299.7830859385
|
||||
},
|
||||
{
|
||||
level: 7,
|
||||
levelValue: 7,
|
||||
resolution: 0.010986328125,
|
||||
scale: 4617149.8915429693
|
||||
},
|
||||
{
|
||||
level: 8,
|
||||
levelValue: 8,
|
||||
resolution: 0.0054931640625,
|
||||
scale: 2308574.9457714846
|
||||
},
|
||||
{
|
||||
level: 9,
|
||||
levelValue: 9,
|
||||
resolution: 0.00274658203125,
|
||||
scale: 1154287.4728857423
|
||||
},
|
||||
{
|
||||
level: 10,
|
||||
levelValue: 10,
|
||||
resolution: 0.001373291015625,
|
||||
scale: 577143.73644287116
|
||||
},
|
||||
{
|
||||
level: 11,
|
||||
levelValue: 11,
|
||||
resolution: 0.0006866455078125,
|
||||
scale: 288571.86822143558
|
||||
},
|
||||
{
|
||||
level: 12,
|
||||
levelValue: 12,
|
||||
resolution: 0.00034332275390625,
|
||||
scale: 144285.93411071779
|
||||
},
|
||||
{
|
||||
level: 13,
|
||||
levelValue: 13,
|
||||
resolution: 0.000171661376953125,
|
||||
scale: 72142.967055358895
|
||||
},
|
||||
{
|
||||
level: 14,
|
||||
levelValue: 14,
|
||||
resolution: 8.58306884765625e-5,
|
||||
scale: 36071.483527679447
|
||||
},
|
||||
{
|
||||
level: 15,
|
||||
levelValue: 15,
|
||||
resolution: 4.291534423828125e-5,
|
||||
scale: 18035.741763839724
|
||||
},
|
||||
{
|
||||
level: 16,
|
||||
levelValue: 16,
|
||||
resolution: 2.1457672119140625e-5,
|
||||
scale: 9017.8708819198619
|
||||
},
|
||||
{
|
||||
level: 17,
|
||||
levelValue: 17,
|
||||
resolution: 1.0728836059570313e-5,
|
||||
scale: 4508.9354409599309
|
||||
},
|
||||
{
|
||||
level: 18,
|
||||
levelValue: 18,
|
||||
resolution: 5.3644180297851563e-6,
|
||||
scale: 2254.4677204799655
|
||||
},
|
||||
{
|
||||
level: 19,
|
||||
levelValue: 19,
|
||||
resolution: 2.68220901489257815e-6,
|
||||
scale: 1127.23386023998275
|
||||
},
|
||||
{
|
||||
level: 20,
|
||||
levelValue: 20,
|
||||
resolution: 1.341104507446289075e-6,
|
||||
scale: 563.616930119991375
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
return data[wkid]
|
||||
},
|
||||
img_c: "http://{subDomain}.tianditu.gov.cn/img_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=" +tk,
|
||||
cia_c: "http://{subDomain}.tianditu.gov.cn/img_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=" +tk
|
||||
|
|
|
@ -4,6 +4,7 @@ import TianData from './Tmap'
|
|||
import TileInfo from "@arcgis/core/layers/support/TileInfo";
|
||||
import WebTileLayer from "@arcgis/core/layers/WebTileLayer";
|
||||
import TileLayer from "@arcgis/core/layers/TileLayer.js";
|
||||
import MapImageLayer from "@arcgis/core/layers/MapImageLayer.js";
|
||||
import Draw from "@arcgis/core/views/draw/Draw.js";
|
||||
import Polyline from "@arcgis/core/geometry/Polyline.js";
|
||||
import Polygon from "@arcgis/core/geometry/Polygon.js";
|
||||
|
@ -69,18 +70,23 @@ const ldMap = {
|
|||
hightlayer: '',
|
||||
pngLayer: null,
|
||||
selectPng: '',
|
||||
wkid: null,
|
||||
//初始化地图
|
||||
initMap: function () {
|
||||
initMap: function (wkid) {
|
||||
|
||||
self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
let tileInfo = new TileInfo(TianData.infoData);
|
||||
if(wkid==self.wkid){
|
||||
resolve()
|
||||
|
||||
}else{
|
||||
let tileInfo = new TileInfo(TianData.infoData(wkid));
|
||||
self.wkid = wkid
|
||||
let defaultInfo = {
|
||||
subDomains: ["t1"],
|
||||
spatialReference: {
|
||||
wkid: 4326,
|
||||
wkid: wkid,
|
||||
},
|
||||
tileInfo: tileInfo,
|
||||
}
|
||||
|
@ -139,7 +145,7 @@ const ldMap = {
|
|||
container: "viewDiv",
|
||||
map: this.map,
|
||||
spatialReference: {
|
||||
wkid: 4326,
|
||||
wkid: wkid,
|
||||
},
|
||||
constraints: {
|
||||
lods: lodsView,
|
||||
|
@ -253,6 +259,10 @@ const ldMap = {
|
|||
resolve()
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
@ -301,10 +311,7 @@ const ldMap = {
|
|||
self.initSketch()
|
||||
},
|
||||
removeAll() {
|
||||
|
||||
|
||||
self.view.map.removeAll();
|
||||
|
||||
},
|
||||
addLayer: function (e) {
|
||||
|
||||
|
@ -312,15 +319,17 @@ const ldMap = {
|
|||
let data = {
|
||||
id: "layerName",
|
||||
url: '',
|
||||
...e
|
||||
...e,
|
||||
spatialReference: {
|
||||
wkid: self.wkid,
|
||||
},
|
||||
}
|
||||
var imgLayer = new TileLayer(data);
|
||||
|
||||
this.map.layers.add(imgLayer);
|
||||
this.map.add(imgLayer);
|
||||
|
||||
imgLayer.when((e) => {
|
||||
self.nowlayer = e
|
||||
|
||||
self.setCenter(e.fullExtent.center.x, e.fullExtent.center.y)
|
||||
})
|
||||
self.view.whenLayerView(imgLayer).then(function (layerView) {
|
||||
|
@ -915,7 +924,7 @@ const ldMap = {
|
|||
type == 'left' ? paths[0][0] = nowXy : paths[0][paths[0].length - 1] = nowXy
|
||||
const polyline = new Polyline({
|
||||
paths: paths,
|
||||
spatialReference: self.view.spatialReference,
|
||||
|
||||
})
|
||||
const length = geometryEngine.geodesicLength(polyline, "meters");
|
||||
console.log(length.toFixed(2))
|
||||
|
@ -945,7 +954,8 @@ const ldMap = {
|
|||
self.sketchLayer.pointLayer.removeAll();
|
||||
self.lineLayer && self.lineLayer.removeAll()
|
||||
self.loadelevationLayer.removeAll()
|
||||
|
||||
self.hightlayer &&self.hightlayer.removeAll()
|
||||
self.textLayer&&self.textLayer.removeAll()
|
||||
},
|
||||
//清除点位
|
||||
removePoint() {
|
||||
|
@ -972,7 +982,7 @@ const ldMap = {
|
|||
data.forEach(item => {
|
||||
const polyline = new Polyline({
|
||||
paths: item.path,
|
||||
spatialReference: self.view.spatialReference,
|
||||
|
||||
|
||||
})
|
||||
const lineSymbol = self.returnLineSymbole(item.width, item.color)
|
||||
|
@ -1202,7 +1212,7 @@ const ldMap = {
|
|||
width: 0
|
||||
}
|
||||
},
|
||||
spatialReference: self.view.spatialReference
|
||||
|
||||
});
|
||||
|
||||
if (data.pointType == 'y') {
|
||||
|
@ -1232,7 +1242,7 @@ const ldMap = {
|
|||
width: 10
|
||||
}
|
||||
},
|
||||
spatialReference: self.view.spatialReference
|
||||
|
||||
});
|
||||
self.pngLayer.add(pointGraphic, 10)
|
||||
},
|
||||
|
@ -1256,7 +1266,7 @@ const ldMap = {
|
|||
height: 20,
|
||||
width: 20,
|
||||
},
|
||||
spatialReference: self.view.spatialReference
|
||||
|
||||
});
|
||||
self.pngLayer.add(pointGraphic, 10)
|
||||
})
|
||||
|
@ -1427,7 +1437,7 @@ const ldMap = {
|
|||
const point = new Point({
|
||||
x: data.path[0],
|
||||
y: data.path[1],
|
||||
spatialReference: self.view.spatialReference
|
||||
|
||||
})
|
||||
|
||||
const newPointGraphic = new Graphic({
|
||||
|
@ -1532,7 +1542,7 @@ const ldMap = {
|
|||
}
|
||||
const polygon = new Polygon({
|
||||
rings: path,
|
||||
spatialReference: self.view.spatialReference
|
||||
//
|
||||
})
|
||||
|
||||
|
||||
|
@ -1557,9 +1567,14 @@ const ldMap = {
|
|||
}
|
||||
|
||||
if (res.type == "House") {
|
||||
try{
|
||||
const areas = geodesicUtils.geodesicAreas([polygon], "square-meters");
|
||||
const area = Math.abs(areas[0]).toFixed(2)
|
||||
res.area = res.area || area
|
||||
}catch{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
const newPolygonGraphic = new Graphic({
|
||||
geometry: polygon,
|
||||
|
@ -1619,7 +1634,6 @@ const ldMap = {
|
|||
color: [255, 255, 255, 255],
|
||||
font: { // autocasts as new Font()
|
||||
size: 12,
|
||||
|
||||
weight: "bold"
|
||||
}
|
||||
}
|
||||
|
@ -2076,7 +2090,7 @@ const ldMap = {
|
|||
let polyline = {
|
||||
type: "polyline", // autocasts as new Polyline()
|
||||
paths: vertices,
|
||||
spatialReference: self.view.spatialReference
|
||||
|
||||
}
|
||||
const lineSymbol = self.returnLineSymbole(3, [0, 255, 255, 255])
|
||||
let graphic = new Graphic({
|
||||
|
@ -2164,7 +2178,7 @@ const ldMap = {
|
|||
hasZ: false,
|
||||
hasM: false,
|
||||
rings: [rings],
|
||||
spatialReference: self.view.spatialReference
|
||||
|
||||
})
|
||||
let graphic = new Graphic({
|
||||
geometry: polygon,
|
||||
|
@ -2604,7 +2618,7 @@ const ldMap = {
|
|||
|
||||
const polygon = new Polygon({
|
||||
rings: data.path,
|
||||
spatialReference: self.view.spatialReference
|
||||
|
||||
|
||||
})
|
||||
let graphic = new Graphic({
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -63,6 +63,11 @@ export default defineConfig(({ mode, command }) => {
|
|||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/afterSales-api/, '')
|
||||
},
|
||||
'/arcgis': {
|
||||
target: 'http://139.224.252.239:6080',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/arcgis-map/, '')
|
||||
},
|
||||
}
|
||||
},
|
||||
//fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
|
||||
|
|
Loading…
Reference in New Issue