Skip to content

Instantly share code, notes, and snippets.

View ravviolo's full-sized avatar

Jolanta Ślipko ravviolo

  • Wrocław, Poland
View GitHub Profile
@ravviolo
ravviolo / geo.js
Created August 6, 2021 13:25 — forked from mkhatib/geo.js
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {