Use google places automcomplete to calculate distance between two entered places

On the homepage of [url removed, login to view] there are 2 autocomplete fields powered by Google. Depending on whatever two places the user enters you have to determine the straight distance between those 2 points. If the distance is smaller than a certain treshold there is a javascript action (hiding of some fields).

Some information I found:

[url removed, login to view]


[url removed, login to view]

This function can be used to calculate the distance between two points:

function distance_slc($lat1, $lon1, $lat2, $lon2) {

$earth_radius = "6371"; # in km

$delta_lat = $lat2 - $lat1 ;

$delta_lon = $lon2 - $lon1 ;

$distance = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($delta_lon)) ;

$distance = acos($distance);

$distance = $earth_radius*$distance;

$distance = round($distance, 4);

return $distance;


Habilidades: Javascript, PHP

Veja mais: php autocomplete, google developers, developers google com, sin cos, can use google places api directory business, google maps distance function, google distance, create google places api use wordpress, information hiding, calculate distance php, javascript php calculate, google places optimisation, google places expert, give google places maintenance, google places rankings, google places submissions, google places optimization, autocomplete google php, php maps distance, php distance google

Acerca do Empregador:
( 64 comentários ) Goes, Netherlands

ID do Projeto: #6893850

22 freelancers estão ofertando em média $84 para esse trabalho


Hello, I am ready to implement a function to calculate distance between 2 points. Can you please contact me to discuss the requirements of this project in more detail? My background: I am a professional web devel Mais

$100 USD in 2 dias
(166 Comentários)

Hi I work towards providing reliable, relevant and robust IT solutions at most competitive prices to my customers. I ensure 100% customer satisfaction so lets start Thanks

$185 USD in 6 dias
(370 Comentários)

Hi, I've gone through with similar job [login to view URL] It do similar job to calculate distance from two cordinations. I'm ready to work on your project. feel free to discuss. Best regard Mais

$100 USD em 1 dia
(130 Comentários)

Hi, I checked your website www.planetrain.com. I can hide the fields required by you based on the distance between two google autocomplete place fields. I have 3+ years of experience in front end development usin Mais

$55 USD em 1 dia
(77 Comentários)

Hi, I have reviewed the site , description and understood it completely. I can do this job for you :) Please get back to me with your kind reply, I am ready to start immediately and assure you to deliver with in men Mais

$99 USD in 0 dias
(162 Comentários)

Hi, I would like to fix this issue of Google Places. Would you please invite in on this project? Looking forward for your reply, regards, Nittile Gupta

$84 USD in 0 dias
(88 Comentários)

Yes Sir, I know how to implement this task, I already faced this problem in many other projects, one was related to filter users in a range on miles and was based on the earth radius distance calculation. So i can im Mais

$255 USD em 1 dia
(22 Comentários)

hi,javascript developer here and i would like to work on your project. plz go through my reviews and discuss with me.I hope you would like to hire [login to view URL]

$30 USD in 2 dias
(70 Comentários)

Hello, I would like to do this project for you, I have done quite a lot of google autocomplete projects and I can do it for you right now.

$83 USD in 3 dias
(95 Comentários)

Hello respected client, here is my geocoding sample [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] Bellow list contained Mais

$50 USD em 1 dia
(54 Comentários)

Hi there, my name is Naseem and I am experienced with google and bing maps. I have already integrated gogle maps created search functions similar to what you are asking. Will be able to deliver your map within couple o Mais

$100 USD em 1 dia
(77 Comentários)

Hello ! I just finished a project using google maps api . And I am also interested in this one!

$45 USD em 1 dia
(30 Comentários)

Dear Provider, Hope you are doing well I have 9+ Years Experience in php/mysql, with 3+ years of experience in Magento and Wordpress Development. 1 - Framework - CodeIgnitor, Database - SqlServer, UI - HTML5(w Mais

$88 USD em 1 dia
(38 Comentários)

Hello, Hope you are doing well. We read your requirement and we are ready to work on your website. OUR SERVICES We have over 6 years experience in PHP Development on both Linux and Windows [login to view URL] having Mais

$55 USD em 1 dia
(9 Comentários)

Er is nog geen voorstel voorzien

$55 USD em 1 dia
(4 Comentários)

I have many experienced with google map api You can see the demo at: [login to view URL] Contact me for the details

$85 USD in 0 dias
(5 Comentários)

Hi, I am having 5 years of experience in PHP, Wordpress, HTML And jquery. I am also used to google api's integration with php websites. i had read the specification of your project. In this the two textbox should sh Mais

$50 USD em 1 dia
(3 Comentários)

hi, here is my last similar project: [login to view URL] I can develop for you also Thanks

$100 USD em 1 dia
(2 Comentários)

Yes understood the requirement, we are expert in the same and already done the same. Please have a look on this interface which has both autocomplete and distance calculation. [login to view URL] Mais

$30 USD em 1 dia
(3 Comentários)

Hi, I am a software engineer with knowledge in geomatics. I have been using the Google Maps API for several years. My current job is in a company which is a Google Partner for geospatial solutions. The Google Maps Mais

$45 USD em 1 dia
(0 Comentários)