[Résolu] How to link a map marker to larger Google Map with same marker
Ce fil est résolu. Voici une description du problème et la solution proposée.
Problem:
How to add a link to a map marker which will open up the same map in Google Maps itself (for a larger map) and still display a marker in the same location?
Solution:
Output the Types address field as part of a google URL in a format like so:
<a href='https://www.google.com/maps/place/[types field='street-address'][/types]'>View address on Google</a>
0% of people find this useful.
This support ticket is created Il y a 6 années et 6 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
How to show a link in popup when marker is clicked with a link to "View larger map" ? I searched a lot but unable to find option to give user link to view the location on larger google map.
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
Where would you expect the users to see a larger map?
You could create a new View to show a larger map.
Say your first map is displaying "location" posts on a map.
Then your second View would need to also display locations on a map (where the settings are to display a larger map), but you would need to add a Query Filter to only show the location set by a URL parameter (e.g. 'locationid'). You would insert this View onto a page (e.g. "detailed map", which has a post ID of 123).
Then in your first map for the marker pop-up you would create a link to the detailed map page, adding a URL parameter for the locationid, something like
Thanks for your reply Nigel. Sorry for confusion, I just want the link to open that location on google maps (maps.google.com) where they can have other options like direction etc....
Les langues: Anglais (English )Espagnol (Español )
Fuseau horaire: Europe/London (GMT+00:00)
You need to output the Google link with the lat and lon in a particular format, and you can use the format attribute in the types shortcode that outputs the address to achieve the required format.
So I added the following to my template for locations which use a "street-address" custom field:
<a href='<em><u>lien caché</u></em> field='street-address' format="@FIELD_LATITUDE,FIELD_LONGITUDE,15z"][/types]'>View on Google</a>
It didnt work but I guess I need to explore a bit more on google api side, I was thinking there must be something in toolset plugin to do it which is why I opened the ticket.