Page 2 of 2

how to calculate distance using longitude and latitude between two points on a custom googlemap?

Posted: Fri Aug 23, 2013 6:14 am
by Kateryna Grynko

Hi Jackson,

In JavaScript, there is the toFixed() method converts a number into a string, keeping a specified number of decimals.

codevar value = 85.08850817788226;
var v = value.toFixed(2);
The result of v is: 85.09/code


how to calculate distance using longitude and latitude between two points on a custom googlemap?

Posted: Fri Aug 23, 2013 6:17 am
by Kateryna Grynko

Please note this is for output only cause further calculations can be broken.


how to calculate distance using longitude and latitude between two points on a custom googlemap?

Posted: Fri Aug 23, 2013 6:20 am
by JACKSON LIANG

oh cause my current position changes every time so my value would also change. Is there a way to convert it using that code on the link above.

https://getsatisfaction.com/apperyio/...


how to calculate distance using longitude and latitude between two points on a custom googlemap?

Posted: Fri Aug 23, 2013 6:25 am
by Kateryna Grynko

Yes, you can see lots of simple possible solutions here: http://stackoverflow.com/questions/41...