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)
Link to google map itinerary
- Jan
- Phoca Hero
- Posts: 48568
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Link to google map itinerary
Hi, for now, there is no such option so this needs to be customized directly in the code. 
Jan

Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 8
- Joined: 31 Dec 2022, 18:16
Re: Link to google map itinerary
Thank you very much.
What are the variables longitude, latitude (in decimal form) of the markers?
What are the variables longitude, latitude (in decimal form) of the markers?
- Jan
- Phoca Hero
- Posts: 48568
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Link to google map itinerary
Hi, what do you mean with variables?
Jan
Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 8
- Joined: 31 Dec 2022, 18:16
Re: Link to google map itinerary
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)
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)
- Jan
- Phoca Hero
- Posts: 48568
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Link to google map itinerary
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?
$markerV->latitude
$markerV->longitude
Mabye I don't fully understand what do you exactly mean?
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 8
- Joined: 31 Dec 2022, 18:16
Re: Link to google map itinerary
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.
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.
- Jan
- Phoca Hero
- Posts: 48568
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Link to google map itinerary
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
Thank you, Jan
If you find Phoca extensions useful, please support the project
-
- Phoca Newbie
- Posts: 8
- Joined: 31 Dec 2022, 18:16
Re: Link to google map itinerary
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
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