|
@@ -1,7 +1,7 @@
|
1
|
1
|
import React from 'react';
|
2
|
2
|
import ReactDOM from 'react-dom';
|
3
|
3
|
import { Map, Marker } from 'react-amap';
|
4
|
|
-import '../amap.less'
|
|
4
|
+import styles from '../amap.less'
|
5
|
5
|
|
6
|
6
|
class Amap extends React.Component {
|
7
|
7
|
constructor(props) {
|
|
@@ -54,7 +54,7 @@ class Amap extends React.Component {
|
54
|
54
|
// document.getElementById('info').innerHTML = '您当前所在城市:'+cityinfo;
|
55
|
55
|
// 地图显示当前城市
|
56
|
56
|
mapInstance.setBounds(citybounds);
|
57
|
|
- }
|
|
57
|
+ }
|
58
|
58
|
}
|
59
|
59
|
})
|
60
|
60
|
})
|
|
@@ -86,20 +86,16 @@ class Amap extends React.Component {
|
86
|
86
|
|
87
|
87
|
return (
|
88
|
88
|
<>
|
89
|
|
- <div style={{ width: '100%', height: '400px' }}>
|
|
89
|
+ <div style={{ width: '100%', height: '400px', position: 'relative' }}>
|
90
|
90
|
<Map events={this.amapEvents} amapkey="f0d1d4f82432504003ebf46e5e36ff03">
|
91
|
91
|
<Marker position={this.markerPosition} events={this.markerEvents} />
|
92
|
92
|
</Map>
|
93
|
93
|
{
|
94
|
|
- <div className="info">
|
95
|
|
- <div className="input-item">
|
96
|
|
- <div className="input-item-prepend">
|
97
|
|
- <span className="input-item-text" style={{ width: '8rem' }}>请输入关键字</span>
|
98
|
|
- </div>
|
99
|
|
- <input id="amapInput" type="text" />
|
100
|
|
- </div>
|
101
|
|
- </div>
|
102
|
|
- }
|
|
94
|
+ <div className={styles.infoBox}>
|
|
95
|
+ <span className={styles.inputText}>请输入关键字</span>
|
|
96
|
+ <input id="amapInput" className={styles.input} type="text" />
|
|
97
|
+ </div>
|
|
98
|
+ }
|
103
|
99
|
</div>
|
104
|
100
|
</>
|
105
|
101
|
)
|