|
@@ -1,6 +1,7 @@
|
1
|
1
|
import React from 'react';
|
2
|
2
|
import Taro from '@tarojs/taro';
|
3
|
|
-import { View, Map } from '@tarojs/components';
|
|
3
|
+import { View, Map, CoverView } from '@tarojs/components';
|
|
4
|
+import { Icon } from '@antmjs/vantui'
|
4
|
5
|
import { getLocation } from '@/utils/authorize';
|
5
|
6
|
import iconPath from '@/assets/icons/marker.png';
|
6
|
7
|
import style from './style.module.less';
|
|
@@ -18,7 +19,7 @@ export default (props) => {
|
18
|
19
|
markers,
|
19
|
20
|
lngLat,
|
20
|
21
|
] = React.useMemo(() => {
|
21
|
|
- const loc = location || currentPos || '116.354259,31.415587';
|
|
22
|
+ const loc = location || currentPos || '116.354259,31.415587';
|
22
|
23
|
const [longitude, latitude] = loc.split(',');
|
23
|
24
|
|
24
|
25
|
const mks = [{
|
|
@@ -35,7 +36,7 @@ export default (props) => {
|
35
|
36
|
[longitude, latitude]
|
36
|
37
|
]
|
37
|
38
|
}, [location, currentPos]);
|
38
|
|
-
|
|
39
|
+
|
39
|
40
|
React.useEffect(() => {
|
40
|
41
|
getLocation().then((res) => {
|
41
|
42
|
setCurPos([res.longitude, res.latitude].join(','));
|
|
@@ -56,14 +57,16 @@ export default (props) => {
|
56
|
57
|
onLocChange(loc);
|
57
|
58
|
}
|
58
|
59
|
}, [location, currentPos]);
|
59
|
|
-
|
|
60
|
+
|
60
|
61
|
return (
|
61
|
62
|
<View className={style['map-wrapper']}>
|
62
|
63
|
<Map
|
63
|
64
|
longitude={lngLat[0]}
|
64
|
65
|
latitude={lngLat[1]}
|
65
|
66
|
markers={markers}
|
66
|
|
- ></Map>
|
|
67
|
+ >
|
|
68
|
+ <CoverView className={style['control']}><Icon name="aim" size="26px" color="rgb(18,183,245)" /></CoverView>
|
|
69
|
+ </Map>
|
67
|
70
|
</View>
|
68
|
71
|
)
|
69
|
72
|
}
|