NodeJs module to calc distances between two points using coords. Originally cloned from https://gist.github.com/1604972. Response is in km
npm install distance.js --save
NodeJs module to calc distances between two points using coords. Originally cloned from https://gist.github.com/1604972. Response is in km
npm install distance.js --save
String.prototype.toSlug = function(){ | |
str = this.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
var from = "ãàáäâèéëêìíïîõòóöôùúüûñç·/_,:;"; | |
var to = "aaaaaeeeeiiiiooooouuuunc------"; | |
for (var i=0, l=from.length ; i<l ; i++) { | |
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
} |