|
@@ -84,9 +84,28 @@ const BuildingBasic = React.forwardRef((props, ref) => {
|
84
|
84
|
setLoading({ ...loading, arround: true })
|
85
|
85
|
Promise.all(POI_TYPES.map(({ key }) => getPoiData({ type: key, location: lngLat, radius: e }))).then((res) => {
|
86
|
86
|
const pois = POI_TYPES.reduce((acc, { key }, inx) => {
|
|
87
|
+ const poiArr = (res[inx] || {}).pois || []
|
|
88
|
+
|
|
89
|
+ // 只用到部分字段
|
|
90
|
+ const arrVal = poiArr.map((poi) => ({
|
|
91
|
+ name: poi.name,
|
|
92
|
+ id: poi.id,
|
|
93
|
+ location: poi.location,
|
|
94
|
+ type: poi.type,
|
|
95
|
+ typecode: poi.typecode,
|
|
96
|
+ pname: poi.pname,
|
|
97
|
+ cityname: poi.cityname,
|
|
98
|
+ adname: poi.adname,
|
|
99
|
+ address: poi.address,
|
|
100
|
+ pcode: poi.pcode,
|
|
101
|
+ adcode: poi.adcode,
|
|
102
|
+ citycode: poi.citycode,
|
|
103
|
+ distance: poi.distance,
|
|
104
|
+ }))
|
|
105
|
+
|
87
|
106
|
return {
|
88
|
107
|
...acc,
|
89
|
|
- [key]: (res[inx] || {}).pois || []
|
|
108
|
+ [key]: arrVal
|
90
|
109
|
}
|
91
|
110
|
}, {})
|
92
|
111
|
|