This commit is contained in:
SmileXin 2025-02-07 23:18:05 +08:00
parent 4697f77226
commit 34ef7c42a6
5 changed files with 205 additions and 176 deletions

View File

@ -51,5 +51,9 @@
"post-merge": "post-npm-install",
"post-rebase": "post-npm-install"
}
}
},
"name": "bmw",
"version": "1.0.0",
"main": "index.js",
"license": "MIT"
}

View File

@ -25,7 +25,7 @@ import { RequestConfig } from '@umijs/max';
export const request: RequestConfig = {
requestInterceptors: [
(url, options) => {
const token = localStorage.getItem('authToken'); // 从某处获取你的认证token例如localStorage
const token = localStorage.getItem('pc-key'); // 从某处获取你的认证token例如localStorage
if (token) {
const headers = {
Authorization: `${token}`,

View File

@ -168,11 +168,10 @@ body {
}
.hiddenBtn{
overflow: hidden;
position: fixed;
position: absolute;
height: 40px;
width: 40px;
top: 220px;
margin: 0 0 0 22%;
margin: 20% 21.4%;
background: rgb(255, 255, 255);
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);
border-radius: 10px;
@ -199,7 +198,7 @@ body {
// margin-left: 0;
}
to {
margin: 0 0 0 4%;
margin: 20% 5%;
}
}
@ -207,12 +206,13 @@ body {
// overflow: hidden;
overflow-y: auto;
overflow-x: hidden;
position: fixed;
top: 190px;
width: 270px;
position: absolute;
// top: 190px;
width: 16.4%;
// width: 270px;
max-height: 450px;
// min-height: 100px;
margin: 2% 4.2%;
margin: 20% 5%;
background: rgba(239,240,248,1);
// background: rgba(239,240,248,0);
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2);

View File

@ -68,7 +68,7 @@ class LayerData extends React.Component {
}
return getBasicLayerMenuApi({ adcode: adcode }).then((e) => {
let basicLayeData = e.data;
console.log('basicLayeData', basicLayeData);
console.log('basicLayeData', e);
// MenuData
let menuDataList = [];
for (var m in basicLayeData) {

View File

@ -105,6 +105,29 @@ class BaseMap extends React.Component{
this.setState({
map: scene,
});
// 地图搜索提示功能
// scene.on('loaded', () => {
// // AutoComplete 插件
// window.AMap.plugin(['AMap.Autocomplete'], () => {
// // Autocomplete 实例配置
// const autoOptions = {
// city: '全国', //城市,默认全国
// input: 'tipinput' //使用联想输入的input的id
// };
// // 创建Autocomplete对象
// const autoComplete = new AMap.AutoComplete(autoOptions);
// });
// // scene.map.plugin(['AMap.Autocomplete'], () => {
// // // Autocomplete 实例配置
// // const autoOptions = {
// // city: '全国', //城市,默认全国
// // input: 'tipinput' //使用联想输入的input的id
// // };
// // // 创建Autocomplete对象
// // const autoComplete = new AMap.autoComplete(autoOptions);
// // });
// })
}
//设置地图省份级别位置
@ -523,6 +546,7 @@ class BaseMap extends React.Component{
//选择市 cityAdcode:市编码 data:市数据
onCityChange = (cityAdcode, data) => {
var self = this;
console.log("cityAdcode", cityAdcode)
if (cityAdcode === undefined || cityAdcode === null || cityAdcode === "" || cityAdcode === 'undefined') {
this.setState({
cityAdcode: '',
@ -589,6 +613,7 @@ class BaseMap extends React.Component{
}
self.startLoading();
let getLayers = self.state.markerLayerList;
console.log("getLayers✈······", getLayers)
for (let i = 0; i < getLayers.length; i++) {
self.state.map.removeMarkerLayer(getLayers[i]);
}