android - 移动端产品,类似链家地图找房功能,如何设计保证当前可视区域内一定有房源?
巴扎黑
巴扎黑 2017-04-18 09:46:51
0
3
981

1、类似链家地图找房功能,找二手房,从板块层级进入小区层级,此时数据量很大,不想一次性获取所有的数据,如果按照当前区域的4个角的经纬度来计算,当前可视区域可能存在没有数据的情况,此时的用户体验不好,如何设计保证当前可视区域内一定有房源

巴扎黑
巴扎黑

reply all(3)
Ty80

Whether the longitude and latitude of the house are within the four corners of the default area? If not, calculate the distance between the house and the location based on the longitude and latitude, and then enlarge the default display area based on the distance

Ty80

I happened to meet a similar requirement, here’s our approach for reference:
1. Initiate a request to pass the current user coordinates to the background.
2. Let the background sort the surrounding properties within a certain range (the background is adjustable) according to the user's location and return.
3. After the front-end requests the data, the nearest listing is the first in the array. At this time, the showAnnotations method of the map API is called to display the user's location and the pins of the nearest listings. (Amap)

Peter_Zhu

1. Submit the current coordinates
2. The server first filters the listings according to the default visible range
3. If there are no listings or the number of listings is small, expand the viewing range and re-filter until enough listing information is filtered out
4. Return to client

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!