Repacked some vanilla JS that calculates metric distance between two latitude and longitude coordinates