Commit 3f7ef70e authored by lihonglin's avatar lihonglin

feat: arcgis

parent 591c803b
......@@ -36,7 +36,8 @@ module.exports = {
type: 'none',
exclude: [
'@wisdom-map/arcgismap',
'@wisdom-map/arcgismap/lib/arcgisapi',
'@wisdom-map/Amap',
'@wisdom-map/Map',
'swagger-ui-react',
'Cesium'
],
......
......@@ -30,12 +30,12 @@ export default {
origin: `//127.0.0.1:8345`
}
},
// {
// name: 'civ_webgis',
// entry: `//${window.location.hostname}:8080/civ_webgis`,
// container: '#micro-container',
// activeRule: '/civbase/civ_energy',
// },
{
name: 'civ_webgis',
entry: `//${window.location.hostname}:8081/civ_webgis`,
container: '#micro-container',
activeRule: '/civbase/civ_webgis',
},
{
name: 'civweb4',
entry: `//${window.location.hostname}:3020/civweb4`,
......
......@@ -18,7 +18,9 @@ const TYPE_ALL_EXCLUDE = [
'lodash',
'react',
'react-dom',
'@wisdom-map/arcgismap'
'@wisdom-map/arcgismap',
'@wisdom-map/Amap',
'@wisdom-map/Map',
];
......
......@@ -102,7 +102,9 @@
"@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/Amap": "^1.0.49-3",
"@wisdom-map/Map": "^1.0.12-9",
"@wisdom-map/arcgismap": "^1.0.79-9",
"@wisdom-map/util": "^1.0.27-0",
"@wisdom-utils/components": "0.0.14",
"@wisdom-utils/runtime": "0.0.15",
......
......@@ -43,6 +43,8 @@ import { actionCreators } from '@/containers/App/store';
import KeepAlive from 'react-activation'
// import CreateBaseMap from '@/pages/map';
import CreateBaseMap from '@/pages/map';
// import Authorized from '@/utils/Authorized';
import { findPathByLeafId, getBaseName } from '@/utils/utils';
// import { renderRoutes } from 'react-router-config';
......@@ -685,7 +687,7 @@ const BasicLayout = props => {
}
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : window.location.pathname.startsWith('/civbase/civ_webgis') ? <CreateBaseMap options={{ type: 'ArcgisMap' }}/> : null
}
<div id="micro-container" className="subapp-container">
......@@ -705,7 +707,7 @@ const BasicLayout = props => {
}
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : window.location.pathname.startsWith('/civbase/civ_webgis') ? <CreateBaseMap options={{ type: 'ArcgisMap' }}/> : null
}
<div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/}
......
......@@ -300,6 +300,10 @@ window.app.define('@wisdom-utils/components', require.context('../node_modules/@
/**
* arcgismap
*/
window.app.define('@wisdom-map/arcgismap', require.context('../node_modules/@wisdom-map/arcgismap/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@wisdom-map/Amap', require.context('../node_modules/@wisdom-map/Amap/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
window.app.define('@wisdom-map/Map', require.context('../node_modules/@wisdom-map/Map/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// window.app.define('@wisdom-map/arcgismap', require.context('../node_modules/@wisdom-map/arcgismap/lib', true, /^.\/(lib\/)?[^\/]+\.js$/), 'index.js');
// // window.app.define('@wisdom-map/arcgismap/lib/widgets', require.context('../node_modules/@wisdom-map/arcgismap/lib/widgets', true, /^.\/(lib\/)?[^\/]+\.js$/));
// window.app.define('@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core', require.context('../node_modules/@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core', true, /^.\/(arcgisapi\/)?[^\/]+\.js$/));
......
......@@ -4,7 +4,7 @@ import { connect } from 'react-redux';
import { actionCreators } from '@/containers/App/store';
import _ from 'lodash';
// import { AMapScene } from '@wisdom-map/Amap';
// import { ArcGISMap } from '@wisdom-map/arcgismap';
import { ArcGISMap } from '@wisdom-map/arcgismap';
// import arcgisConfig from '@wisdom-map/arcgismap/lib/arcgisapi/4.20/@arcgis/core/config';
// import pkg from '../../../package.json';
// arcgisConfig.assetsPath = `${window.location.origin}/${pkg.name.toLocaleLowerCase()}/assets`;
......@@ -22,14 +22,14 @@ class Map extends React.PureComponent {
}
transformMapsetting(mapsettings) {
// let layers = mapsettings.layers;
// layers = layers.map(item => {
// item.url = /^\//.test(item.url) ? `/${item.url}`: item.url;
// return item;
// })
// return Object.assign({}, mapsettings, {
// layers: layers
// });
let layers = mapsettings.layers;
layers = layers.map(item => {
item.url = /^\//.test(item.url) ? `/${item.url}`: item.url;
return item;
})
return Object.assign({}, mapsettings, {
layers: layers
});
}
destroyAMap() {
......@@ -80,7 +80,7 @@ class Map extends React.PureComponent {
}
getArcGISMap(map) {
// this.props.updageMapView(map);
this.props.updageMapView(map);
}
show() {
......@@ -96,17 +96,17 @@ class Map extends React.PureComponent {
}
render() {
// return (
// <>
// {
// this.state.type === 'AMap' ? (
// <div {...this.state} getMapInfo={this.getAMap.bind(this)}/>
// ) : (
// <ArcGISMap config={this.state.options} getMapInfo={this.getArcGISMap.bind(this)}/>
// )
// }
// </>
// )
return (
<>
{
this.state.type === 'AMap' ? (
<div {...this.state} getMapInfo={this.getAMap.bind(this)}/>
) : (
<ArcGISMap config={this.state.options} getMapInfo={this.getArcGISMap.bind(this)}/>
)
}
</>
)
}
}
const mapStateToProps = state => ({});
......
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