Var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)) Įlse if (d<=1) return Math.round(d*5280)+"ft" Īgain, thanks for publishing this. Var a = Math.sin(dLat/2) * Math.sin(dLat/2) + ![]() Var R = 3959 // Here's the right settings for miles and feet Var ruler1=r var ruler2=r var ruler1label=r var ruler2label=r var rulerpoly=r I've unpacked the variables for readability. ![]() Var div = document.getElementById('ruler' + num) Then, you can select multiple other points on the map to calculate the total. Here is the intial code for ruler.js with the addruler method, the file now is a bit changed and has more features: To measure distance on Google Maps on a desktop, right-click on your starting point, then choose measure distance.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |