0

I'm developing app with geolocalization. I want to display on my map (for example) stores that are nearest of my current position. I have lati and longitude saved for each store in my db and I have current position of user. Now I want to get from db nearest positions from me in arial of my zoom.

I don't want to pick them all cause if I'll have 10000 positions adding them to db (like also getting them from db) will be long and cpu consuming. Thats why I want to pick only those that can be displayed on map.

Map is centered on my current position. How to get them ? How to count this ?

4

1 回答 1

1

您可以使用Haversine 公式计算任意两点经纬度之间的距离。您可以构建一个存储过程(甚至是CLR 存储过程),它获取当前位置和距离并计算该区域内的所有点。

于 2012-09-09T01:31:42.450 回答