I have a multidimensional array of latitudes and longitudes, and one other single marker "m". I need to get the two most closest points to "m" from the array for creating two other markers. Any help would be highly appreciated.
this is the array of lats and lons
var locations= [
['loc1', 54.1121824,-1.3983992],
['loc2', 54.2121824,-1.4323992],
['loc3', 54.4121824,-1.5993992],
['loc4', 54.3871874,-1.6773992],
['loc5', 54.1963824,-1.5983992]
];
I want to get the most two closest points to m=54.1143824,-1.4963992
for creating two markers from them