我有很多公司。每个企业都有一个完整地址形式的位置字段: 业务示例:
{
name: "MSBIZ",
location: "347 Broadway, New York, NY, USA"
}
我也正在获取当前用户位置。例子:
{
"city": "New York",
"continent_code": "NA",
"continent_name": "North America",
"country_code": "US",
"country_name": "United States",
"ip": "74.68.108.199",
"latitude": 40.7651,
"location": Object {
"calling_code": "1",
"capital": "Washington D.C.",
"country_flag": "http://assets.ipstack.com/flags/us.svg",
"country_flag_emoji": "",
"country_flag_emoji_unicode": "U+1F1FA U+1F1F8",
"geoname_id": 5128581,
"is_eu": false,
"languages": Array [
Object {
"code": "en",
"name": "English",
"native": "English",
},
],
},
"longitude": -73.9638,
"region_code": "NY",
"region_name": "New York",
"type": "ipv4",
"zip": "10065",
}
我想根据与当前用户所在位置的邻近程度来对我的业务进行排序。如何以最有效的方式做到这一点?