I used the patches located here (http://drupal.org/node/346694) to have google maps display, which worked great. Hovever, when theming my node using contemplate I cannot find anything that would print out a google map link. I know this is a bit obscure but if anyone else have an idea on how to address this I would appreciate the help.

thanks, ian

Comments

hampshire’s picture

I am trying to do the same thing with the 5.x version and having no luck as well. I was under the impression that the code below would work but nothing is returned. I just want a link to the address on google.com so visitors can get driving directions.

<?php print $node->location['map_link'] ?>

It seems people have it working here (http://drupal.org/node/350646) but I was unable figure out how.

If anyone knows how to print the url to google that would be great, I really just want the http://maps.google.com/whatever_it_take_to_load_the_address so I can format the link myself.

Thanks.

fletch11’s picture

This worked for me:

<a href="<?php $linktext = location_map_link_us_google($locations[0]);
print $linktext?>">Google Map</a>
yesct’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Location theming, +location theming map links

Does this fix it for you? Post back if you still need help.

yesct’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)
Issue tags: +location useful code

Marking this closed since no response. Please reply if still an issue for you.

selwynpolit’s picture

Version: 6.x-3.x-dev » 6.x-3.1
Category: bug » support

I was trying to get map links to show for a node by putting some code into my node.tpl.php and the only way I could make it work was by using the following:

print location_map_link($node->field_location[0]);

In this case, I have added a cck location field (I called it location) into my node content type and I am trying to show a link that says: see maps with links to the configured map services. If you add a field called place, the code above would read ...$node->field_place[0]. I had enabled google, yahoo and mapquest so they all show up link this:

See map: Google Maps, Yahoo! Maps, MapQuest

Maybe this will help someone else.
fyi. I found this function in the location module in location.inc.

Selwyn