Page 1 of 1

Link to google map itinerary

Posted: 10 Feb 2025, 11:33
by pcharra
Hello
I would like to create a link in each marker to
https://www.google.com/maps/dir//latitude,longitude/
for example
https://www.google.com/maps/dir//45.091 ... 452854568/
retrieving the marker's latitude and longitude data, with variables.
Currently I enter the data manually.
Just so you know, this allows me to have all the route options (alternative, toll-free etc...) which I can't get with the button proposed by phocamap.
Thanks in advance for your help

https://imgur.com/a/ERLB167

Translated with DeepL.com (free version)

Re: Link to google map itinerary

Posted: 10 Feb 2025, 13:31
by Jan
Hi, for now, there is no such option so this needs to be customized directly in the code. :idea:

Jan

Re: Link to google map itinerary

Posted: 10 Feb 2025, 18:09
by pcharra
Thank you very much.
What are the variables longitude, latitude (in decimal form) of the markers?

Re: Link to google map itinerary

Posted: 17 Feb 2025, 12:33
by Jan
Hi, what do you mean with variables?

Jan

Re: Link to google map itinerary

Posted: 18 Feb 2025, 12:49
by pcharra
Hello
I would like to add this line in the php script default.php or default_osm.php after the markers title. I would like to retrieve the numerical values of the marker's gps coordinates, longitude and latitude.

// Ajouter le lien d'itinéraire Google Maps
$text .= '<div><a href="https://www.google.com/maps/dir/?api=1&destination=' . $markerV->latitude . ',' . $markerV->longitude . '“ target=”_blank">Itinéraire Google Maps</a></div>';

Translated with DeepL.com (free version)

Re: Link to google map itinerary

Posted: 21 Feb 2025, 21:39
by Jan
Hi, depends on where you want to get them, the coordinates are just stored in the $markerV variable:

$markerV->latitude
$markerV->longitude

Mabye I don't fully understand what do you exactly mean?

Re: Link to google map itinerary

Posted: 22 Feb 2025, 17:59
by pcharra
Hello
Thanks to Mistral AI. It works. You had to modify the scripts phocamapsmap.php and phocamapsmaposm.php in
administrator/components/com_phocamaps/helpers
I have the modified files available for those who are interested.
Problem solved for me.

Re: Link to google map itinerary

Posted: 27 Feb 2025, 02:02
by Jan
Hi, great to hear it, will be great e.g. to get links to such modified files (e.g. on github, etc.).

Thank you, Jan

Re: Link to google map itinerary

Posted: 01 Mar 2025, 15:51
by pcharra
Hello
Here is the link to the 2 modified files.

https://www.dropbox.com/scl/fi/9yvqowv6 ... acgmv&dl=0

It displays ‘Itinéraire Googlemaps’ in French.
You still have to modify the code for the language files