Commit df592377 authored by xuchaozou's avatar xuchaozou

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

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