Google Map Element link to GoogleMaps URL

Sorry to pile up the questions and to be such a burden. What is the best way to link a google map in detail view to open the full Google Maps URL in a new window (e.g., https://maps.google.com/maps?q=number+streetname+streettype+city+state+zip&vpsrc=x&z=xx)?

I searched for on click javascript solutions, but I could not get them to work (placeholder issue. I also played around with calling a calc element via javascript, but that did not fly either. I don't think a custom link in the link to details is what I am after, as I am already inside of a detail view, and I am not referencing an internal link.

Is this feature built into the element? Is there a way to call the new page via javascript, using the address fields or the geocode?
 
Okay. I answered my own question...sort of. I was able to use a calc element to get a larger map to load in a new window with the following:

$link= '<a target="_blank" href="https://maps.google.com/maps?q={locations___establishmentaddressstreet}+{locations___establishmentaddresscity}+{locations___establishmentaddressstate}+{locations___establishmentaddresszip}&vpsrc=0&z=13">View Larger Map and Get Directions</a>';
return $link;

This does not help me to link the map image, but I may be on the right track.
 
It's working with a custom link set to "Custom link in details" =yes - but only opening in the same window :(

It would be nice to have a link target option.
 
This does not help me to link the map image
Does that mean that you want a google static map image inside the <a> tag?

If so this should do the trick

HTML:
$address = "{locations___establishmentaddressstreet}+{l   ocations___establishmentaddresscity}+{locations___   establishmentaddressstate}+{locations___establishm   entaddresszip}";

$src = "http//maps.google.com/maps/api/staticmap?center=$address&amp;zoom=5&amp;size=150x150&amp;maptype=roadmap&amp;mobile=true&amp&amp;sensor=false";

$link= '<a target="_blank"  href="https://maps.google.com/maps?q=' . $address . '&vpsrc=0&z=13">
<img src="' . $src . '" alt="View Larger Map and Get  Directions" /></a>';
return $link;
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top