Javascript 获取与api对应的我的位置最近的位置

Javascript 获取与api对应的我的位置最近的位置,javascript,google-location-services,Javascript,Google Location Services,我有一个API,它返回一个经度和纬度数组,如下所示: [{ product: "a", "geo_latitude": 60.17, "geo_longitude": 24.97 },{ product: "b", "geo_latitude": 48.85, "geo_longitude": 2.35 },{ product: "c", "

我有一个API,它返回一个经度和纬度数组,如下所示:

[{
product: "a",
"geo_latitude": 60.17,
 "geo_longitude": 24.97
},{
product: "b",
 "geo_latitude": 48.85,
 "geo_longitude": 2.35
},{
product: "c",
 "geo_latitude": 48.86,
 "geo_longitude": 2.35
}
];
我的位置是,例如:lat:51.48,long:12.43,所以我想从我收到的数组中,从我自己的位置获得产品的最近位置

我可以使用普通位置API:

window.navigator.geolocation
  .getCurrentPosition(console.log, console.log);