Geolocation Library

https://github.com/bmoren/p5.geolocation

This library provides techniques for acquiring, watching, calculating, and geofencing user locations. Some of the functions are geoCheck(), getCurrentPosition(), watchPosition() and clearWatch().

An example of code making use of geo location:

var distance;

function setup(){

distance = calcGeoDistance(46.785844, -92.015965, 44.940834, -93.311287, ‘mi’)

print(distance);

}

This function calcGeoDistance calculates the distance between two coordinates. The last part ‘mi’ indicates units.