• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Distance calculation

Distance calculation 9 years 7 months ago #28614

  • feraut
  • feraut's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Hi !
i found a solution to fill fields with adresses with google fields: adresseA and AdressB

And now i would like to calculate the distance between the two adresses.
I have the google script just below, but i don't know where to put it to have the field "distance" filled with the result of the calcul ?

An idea ?

Thank's a lot for your help !!!

exemple of SCRIPT :

function getDistance($adresse1,$adresse2) {
$url='maps.google.com/maps/api/directions/xml?...esse2.'&sensor=false';
$xml=file_get_contents($url);
$root = simplexml_load_string($xml);
$distance=$root->route->leg->distance->value;
$duree=$root->route->leg->duration->value;
$etapes=$root->route->leg->step;
return array(
'distanceEnMetres'=>$distance,
'dureeEnSecondes'=>$duree,
'etapes'=>$etapes,
'adresseDepart'=>$root->route->leg->start_address,
'adresseArrivee'=>$root->route->leg->end_address
);
}
The administrator has disabled public write access.

Distance calculation 9 years 4 months ago #29844

  • dispatch
  • dispatch's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 1
Good day feraut,

I see this is unanswered but I am wondering if you have made any headway on it? I am just purchased Pro a month ago, and will be starting to do a simple thing to start, like you have done... May I see it live?

My goal is to user enter multiple points and draw the map.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!