Commit 48ef09be authored by 邓晓峰's avatar 邓晓峰

fix: 修复arcgismap/core初始化

parent 5ff91f02
......@@ -35,8 +35,8 @@ module.exports = {
nodeModulesTransform: {
type: 'none',
exclude: [
'@wisdom-map/arcgismap',
'@wisdom-map/arcgismap/lib/arcgisapi',
// '@wisdom-map/arcgismap',
// '@wisdom-map/arcgismap/lib/arcgisapi',
'swagger-ui-react',
'Cesium'
],
......
......@@ -20,25 +20,18 @@ module.exports = opts => {
const preset = {
presets: [
opts.env && [
'@babel/preset-env',
require('@umijs/deps/compiled/babel/preset-env'),
{
...mergeConfig(defaultEnvConfig,{}),
modules: false,
...opts.env
},
],
// opts.react && ['@babel/preset-react'],
// opts.typescript && [
// '@babel/preset-typescript',
// {
// allowNamespaces: true,
// },
// ],
].filter(Boolean),
plugins: [
['@babel/plugin-proposal-optional-chaining', { loose: false }],
['@babel/plugin-proposal-nullish-coalescing-operator', { loose: false }],
'@babel/plugin-syntax-top-level-await',
require('@umijs/deps/compiled/babel/plugin-syntax-top-level-await').default,
['@babel/plugin-transform-destructuring', { loose: false }],
// opts.typescript && ['babel-plugin-transform-typescript-metadata'],
['@babel/plugin-proposal-decorators', { legacy: true }],
......@@ -58,7 +51,7 @@ module.exports = opts => {
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-transform-react-jsx',
opts.transformRuntime && [
'@babel/plugin-transform-runtime',
require('@umijs/deps/compiled/babel/plugin-transform-runtime').default,
{
version: require('@babel/runtime/package.json').version,
absoluteRuntime: dirname(
......@@ -98,11 +91,23 @@ module.exports = opts => {
'@umijs/babel-plugin-import-to-await-require',
opts.importToAwaitRequire,
],
'react-activation/babel'
// opts.lockCoreJS3 && [
// '@umijs/babel-plugin-lock-core-js-3',
// opts.lockCoreJS3,
// ],
'react-activation/babel',
opts.lockCoreJS3 && [
'@umijs/babel-plugin-lock-core-js-3',
opts.lockCoreJS3,
],
opts.noAnonymousDefaultExport && [
require.resolve('@umijs/babel-plugin-no-anonymous-default-export'),
],
[
require('@umijs/deps/compiled/babel/plugin-proposal-record-and-tuple')
.default,
{
syntaxType: 'hash',
polyfillModuleName: '@umijs/deps/reexported/record-tuple-polyfill',
importPolyfill: true,
},
],
].filter(Boolean),
env: {
production: {
......
......@@ -18,7 +18,7 @@ const TYPE_ALL_EXCLUDE = [
'lodash',
'react',
'react-dom',
'@wisdom-map/arcgismap'
// '@wisdom-map/arcgismap'
];
......
......@@ -215,7 +215,7 @@ module.exports = options => {
chainConfig.module
.rule('js')
.test(/\.(js|mjs|jsx|ts|tsx)$/)
.include.add([cwd, ...(process.env.APP_ROOT ? [process.cwd()] : [])])
.include.add([/node_modules\/@esri/, cwd, ...(process.env.APP_ROOT ? [process.cwd()] : [])])
.end()
.exclude.add(/node_modules/)
.add(/\.mfsu/)
......
This diff is collapsed.
......@@ -90,6 +90,8 @@
"babel-core": "7.0.0-bridge.0"
},
"dependencies": {
"@esri/calcite-colors": "6.0.3",
"@esri/arcgis-html-sanitizer": "2.9.1",
"@amap/amap-jsapi-loader": "^1.0.1",
"@ant-design/colors": "^5.0.1",
"@ant-design/icons": "^4.0.0",
......@@ -102,7 +104,7 @@
"@wisdom-cesium/cesium": "^1.0.64",
"@wisdom-components/basictable": "^1.5.16",
"@wisdom-components/empty": "^1.4.1",
"@wisdom-map/arcgismap": "^1.0.60-0",
"@wisdom-map/arcgismap": "^1.0.75-0",
"@wisdom-map/util": "^1.0.27-0",
"@wisdom-utils/components": "0.0.14",
"@wisdom-utils/runtime": "0.0.15",
......@@ -289,7 +291,7 @@
"traverse": "^0.6.6",
"umi-webpack-bundle-analyzer": "3.6.0",
"url-loader": "1.1.2",
"webpack": "^5.65.0",
"webpack": "^5.70.0",
"webpack-chain": "6.5.1",
"webpack-cli": "4.2.0",
"webpack-dev-middleware": "5.3.0",
......
// eslint-disable-next-line import/extensions
// import arcgisConfig from '@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/config';
import React from 'react';
// eslint-disable-next-line import/extensions
import { ArcGISMap as MapComponent } from '@wisdom-map/arcgismap';
// import MapComponent from './lib/index.js';
// eslint-disable-next-line react/prefer-stateless-function
export default class ArcGISMap extends React.Component {
render() {
// arcgisConfig.assetsPath = `${window.location.origin
// }/${pkg.name.toLocaleLowerCase()}/assets`;
return <MapComponent {...this.props} />;
}
}
@import '~antd/es/style/themes/default.less';
.view {
position: absolute;
top:0;
right: 0;
bottom: 0;
left: 0;
.loadingBox{
position: absolute;
left: calc(50% - 40px);
top: calc(50% - 23px);
color: @text-color;
}
.mapBox {
width: 100%;
height: 100%;
}
}
......@@ -42,7 +42,7 @@ import CesiumMap from '../pages/cesiumMap';
import { actionCreators } from '@/containers/App/store';
import KeepAlive from 'react-activation'
// import CreateBaseMap from '@/pages/map';
import CreateBaseMap from '@/pages/baseMapPage/baseMapPage';
// import Authorized from '@/utils/Authorized';
import { findPathByLeafId, getBaseName } from '@/utils/utils';
// import { renderRoutes } from 'react-router-config';
......@@ -687,9 +687,12 @@ const BasicLayout = props => {
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
}
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <CreateBaseMap /> : null
}
<div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/}
{props.children}
</div>
{props.children}
......@@ -707,6 +710,10 @@ const BasicLayout = props => {
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
}
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <CreateBaseMap /> : null
}
<div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/}
{props.children}
......
import React from 'react';
import { Spin } from 'antd';
import { connect } from 'react-redux';
import { actionCreators } from '@/containers/App/store';
import MapComponent from '@/components/mapView';
import style from './baseMapPage.less';
class CreateMap extends React.Component {
constructor(props) {
super(props);
this.mapManganerRef = React.createRef();
}
state = {
loading: true,
config: window.globalConfig.mapsettings,
widgets: window.globalConfig.uiwidgets,
};
getView = view => {
this.props.updageMapView(view);
};
render() {
return (
<>
<MapComponent {...this.state} getMapInfo={this.getView} />
</>
);
}
}
const mapStateToProps = state => ({});
const mapDispatchToProps = dispatch => ({
updageMapView(mapView) {
dispatch(actionCreators.updageMapView(mapView));
},
});
export default connect(
mapStateToProps,
mapDispatchToProps,
)(CreateMap);
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