Commit fc08153e authored by 邓晓峰's avatar 邓晓峰

feat: 集成ARGGIS

parent f432d5fc
This diff is collapsed.
// 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} />;
}
}
......@@ -669,10 +669,14 @@ const BasicLayout = props => {
}
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : !window.location.pathname.startsWith('/civbase/civweb4') ? <CreateBaseMap options={{ type: 'ArcgisMap' }} /> : null
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
}
{
window.location.pathname.startsWith('/civbase/civ_webgis') ? <CreateBaseMap /> : null
}
<div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/}
{/* <CreateBaseMap/> */}
{props.children}
</div>
{props.children}
......@@ -688,7 +692,12 @@ const BasicLayout = props => {
}
{
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : !window.location.pathname.startsWith('/civbase/civweb4') ? <CreateBaseMap options={{ type: 'ArcgisMap' }} /> : null
window.location.pathname.startsWith('/civbase/civ_3d') ? <KeepAlive><CesiumMap /></KeepAlive> : null
}
{
window.location.pathname.startsWith('/civbase/civ_webgis') ? <CreateBaseMap /> : null
}
<div id="micro-container" className="subapp-container">
{/*<CreateBaseMap/>*/}
......
/* eslint-disable */
import React from 'react';
import { Spin } from 'antd';
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 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`;
// window.arcgisAssetsPath = arcgisConfig.assetsPath;
class Map extends React.PureComponent {
constructor(props) {
super(props);
this.options = _.merge({}, props.options);
this.state = {
type: props.options.type,
loading: true,
options: this.transformMapsetting(window.globalConfig.mapsettings),
widgets: window.globalConfig.uiwidgets,
}
}
import MapComponent from '@/components/mapView';
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
});
}
destroyAMap() {
// const mapKey = [
// '_AMap_AMap.MapType',
// '_AMap_labelcanvas',
// '_AMap_imagelayer',
// '_AMap_anole',
// '_AMap_AMap.Scale',
// '_AMap_rbush',
// '_AMap_AMap.IndoorMap',
// '_AMap_AMap.CustomLayer',
// '_AMap_AMap.MarkerClusterer',
// '_AMap_vectorlayer',
// '_AMap_AMap.OverView',
// '_AMap_sync',
// '_AMap_AMap.PlaceSearch',
// '_AMap_AMap.DistrictSearch',
// '_AMap_Map3D',
// '_AMap_AMap.Autocomplete',
// '_AMap_AMap.Heatmap',
// '_AMap_wgl',
// '_AMap_overlay',
// '_AMap_cvector',
// '_AMap_AMap.ToolBar',
// '_AMap_mouse',
// '_AMap_AMap.RangingTool',
// '_AMap_data.tileKeys'
// ];
// // eslint-disable-next-line no-plusplus
// for (let i = 0; i < mapKey.length; i++) {
// localStorage.removeItem(mapKey[i]);
// }
// delete window.AMap;
// delete window.AMapUI;
// delete window.AMapUI_DEBUG;
}
componentWillMount() {
// this.destroyAMap()
}
getAMap(AMapObj, AMap) {
// this.props.updageMapView({
// AMapObj,
// AMap
// });
}
getArcGISMap(map) {
this.props.updageMapView(map);
}
show() {
}
hide() {
// import style from './baseMapPage.less';
class CreateMap extends React.Component {
constructor(props) {
super(props);
this.mapManganerRef = React.createRef();
}
destroy() {
state = {
loading: true,
config: window.globalConfig.mapsettings,
widgets: window.globalConfig.uiwidgets,
};
}
getView = view => {
this.props.updageMapView(view);
};
render() {
return (
<>
{
this.state.type === 'AMap' ? (
<div {...this.state} getMapInfo={this.getAMap.bind(this)} />
) : (
<ArcGISMap config={this.state.options} getMapInfo={this.getArcGISMap.bind(this)} />
)
}
<MapComponent {...this.state} getMapInfo={this.getView} />
</>
)
);
}
}
const mapStateToProps = state => ({});
const mapDispatchToProps = dispatch => ({
......@@ -120,4 +43,4 @@ const mapDispatchToProps = dispatch => ({
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Map);
)(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