Commit 68952f56 authored by 邓晓峰's avatar 邓晓峰

fix: AMAP 多版本SDK兼容

parent 46237ddf
Pipeline #47008 skipped with stages
......@@ -47,17 +47,7 @@ instanceRequest.setErrorHandler(error => {
const errorText = codeMessage[response.status] || response.statusText;
const { status, config } = response;
if (status === 401) {
if (!instance) {
instance = warning({
title: '错误信息',
content: `${codeMessage[status]}`,
centered: true,
onOk(close) {
event.emit('event:logout');
close();
},
});
}
event.emit('event:logout');
} else {
// notification.error({
// message: `请求错误 ${status}: ${config.url}`,
......
......@@ -3,36 +3,21 @@ import _ from 'lodash'
import { connect } from 'react-redux';
import { actionCreators } from '@/containers/App/store';
import MapComponent from '@/components/mapView';
import AMapLoader from '@amap/amap-jsapi-loader';
class CreateMap extends React.Component {
constructor(props) {
super(props);
this.mapManganerRef = React.createRef();
['_AMap_vectorlayer', '_AMap_AMap.MouseTool', '_AMap_AMap.DistrictSearch', '_AMap_AMap.Autocomplete', '_AMap_sync', '_AMap_AMap.PlaceSearch', '_AMap_wgl', '_AMap_overlay', '_AMap_mouse'].forEach(item => {
localStorage.removeItem(item)
});
AMapLoader.reset();
}
// state = {
// loading: true,
// config: this.props.global.mapsettings,
// widgets: this.props.global.uiwidgets,
// };
// componentWillReceiveProps(nextProps) {
// if(nextProps.global.mapsettings !== this.props.global.mapsettings) {
// this.setState(Object.assign({}, this.state, {
// config: nextProps.global.mapsettings
// }))
// }
// if(nextProps.global.uiwidgets !== this.props.global.uiwidgets) {
// this.setState(Object.assign({}, this.state, {
// widgets: nextProps.global.uiwidgets
// }))
// }
// }
getView = view => {
console.log(view)
this.props.updageMapView(view);
};
......
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