Commit df592377 authored by xuchaozou's avatar xuchaozou

chore: 使用新版地图,剔除对老版地图依赖

parent 37561869
Pipeline #95277 failed with stages
......@@ -94,9 +94,9 @@
"@wangeditor/editor-for-react": "^1.0.6",
"@wisdom-cesium/cesium": "1.1.12",
"@wisdom-cesium/krpano": "^1.0.29-60",
"@wisdom-map/amap":"^2.0.15",
"@wisdom-map/arcgismap":"^2.0.97",
"@wisdom-map/basemap":"^2.0.4",
"@wisdom-map/gis-component": "^1.0.22",
"@wisdom-map/gis-utils": "^1.0.19",
"@wisdom-map/pd-map": "^1.0.105",
"@wisdom-utils/components": "0.1.337",
"@wisdom-utils/utils": "0.1.377",
"ace-builds": "^1.4.12",
......@@ -290,4 +290,4 @@
"whatwg-fetch": "3.0.0",
"yorkie": "^2.0.0"
}
}
\ No newline at end of file
}
......@@ -8,7 +8,6 @@ import 'sanitize.css/sanitize.css';
import React from 'react';
import ReactDOM from 'react-dom';
// import { ArcGISMap as MapComponent } from '@wisdom-map/arcgismap';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
import { ConnectedRouter } from 'connected-react-router/immutable';
......
/* eslint-disable no-new */
import React, { useEffect, useState, useRef } from 'react';
import { ArcGISMap, Drawtool, geomUtils } from '@wisdom-map/arcgismap';
// import { AMapScene, PointLayer } from '@wisdom-map/Amap';
import {
Modal,
Form,
......@@ -114,12 +112,12 @@ const Map = props => {
mapRef.current.changeBoundWidthValue(obj.layers[index].boundWidth);
break;
case 'areaName':
Drawtool.deactivate(false);
// Drawtool.deactivate(false);
obj.layers[index].areaName = changedFields[0].value[changedFields[0].value.length - 1];
mapRef.current.changeAreaName(obj.layers[index].areaName);
break;
case 'schemename':
Drawtool.deactivate(false);
// Drawtool.deactivate(false);
let setttings;
obj.layers.forEach(item => {
if (item.schemename === changedFields[0].value) {
......@@ -146,36 +144,36 @@ const Map = props => {
};
// 选择范围
const onTangleClick = e => {
Drawtool.activate({
view: mapInfo.current,
action: 'extent',
drawEnd: data => {
const geom = geomUtils.toGeometry({
type: 'extent',
xmin: data.rings[0][0][0],
xmax: data.rings[0][2][0],
ymin: data.rings[0][0][1],
ymax: data.rings[0][1][1],
});
form.setFieldsValue({
extent: `${data.rings[0][0][0]},${data.rings[0][0][1]},${data.rings[0][2][0]},${data.rings[0][1][1]
}`,
});
mapRef.current.gotoGeometry(geom);
},
});
// Drawtool.activate({
// view: mapInfo.current,
// action: 'extent',
// drawEnd: data => {
// const geom = geomUtils.toGeometry({
// type: 'extent',
// xmin: data.rings[0][0][0],
// xmax: data.rings[0][2][0],
// ymin: data.rings[0][0][1],
// ymax: data.rings[0][1][1],
// });
// form.setFieldsValue({
// extent: `${data.rings[0][0][0]},${data.rings[0][0][1]},${data.rings[0][2][0]},${data.rings[0][1][1]
// }`,
// });
// mapRef.current.gotoGeometry(geom);
// },
// });
};
const onFinish = () => {
console.log(form.getFieldValue('extent'));
console.log(Drawtool.graphic, 'Drawtool');
if (!Drawtool.graphic) {
notification.error({
message: '提示',
duration: 3,
description: '请选择复位范围再保存',
});
return;
}
// console.log(form.getFieldValue('extent'));
// console.log(Drawtool.graphic, 'Drawtool');
// if (!Drawtool.graphic) {
// notification.error({
// message: '提示',
// duration: 3,
// description: '请选择复位范围再保存',
// });
// return;
// }
const obj = form.getFieldsValue();
const jsConfig = {
......@@ -271,7 +269,7 @@ const Map = props => {
</div>
<div className={styles.mapBox}>
{canLoadMap && (
<ArcGISMap ref={mapRef} getMapInfo={e => getMapInfo(e)} config={mapsettings} />
// <ArcGISMap ref={mapRef} getMapInfo={e => getMapInfo(e)} config={mapsettings} />
)}
</div>
</div>
......
......@@ -3,9 +3,8 @@ import React, { useEffect, useState, useRef } from 'react';
import SiteModal from '@/components/Modal/SiteModa';
import { Spin } from 'antd';
import { GetMetaDataPreview, GetTransformationGeom } from '@/services/gis/gis';
import { ArcGISSceneMap } from '@wisdom-map/arcgismap';
import {PdMap} from '@wisdom-map/pd-map'
import axios from 'axios';
import { getConditionList } from '@wisdom-map/basemap';
const VectorPreviewModal = props => {
const { metaData, visible } = props;
......@@ -67,7 +66,7 @@ const VectorPreviewModal = props => {
id: metaData?.GISServerProjectName,
title: metaData?.GISServerProjectName,
icon: '',
layerType: '',
layerType: 'PipenetLayer',
url: `/PandaGIS/MapServer/${metaData?.GISServerProjectName}`,
opacity: '1.0',
showLegend: true,
......@@ -80,7 +79,7 @@ const VectorPreviewModal = props => {
origin: '',
tileMatrix: '',
wmtsUrl: '',
schemename: '',
schemename: '测试方案',
roles: '',
areaName: '',
boundColor: '#86c8f8',
......@@ -141,9 +140,9 @@ const VectorPreviewModal = props => {
<Spin spinning={isLoading}>
<div style={{ width: '1000px', height: '500px' }}>
{currentMeta && (
<ArcGISSceneMap
getMapInfo={e => getMapInfo(e)}
config={currentMeta}
<PdMap
getPdScene={e => getMapInfo(e)}
config={currentMeta?.layers}
client="sandbox"
widgets={[]}
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment