Gossamer Forum
Home : Products : Links 2.0 : Customization :

Linking to Google Maps?

Quote Reply
Linking to Google Maps?
Anybody know how to link Google/Microsoft maps to links in Links2? Thanks, Gene C
Gene99
Quote Reply
Re: [gene99] Linking to Google Maps? In reply to
The link for googlemaps would look like this:

<a target="_blank" href=" http://maps.google.com/maps?q=<%street_address_url%>+<%city_url%>+<%state%>">Map to <%Title%>.</a>

Or mapquest:

<a href="http://www.mapquest.com/maps/map.adp?address=<%street_address_url%>&city=<%city_url%>&state=<%state%>">Map to <%Title%>.</a>

Add this to site_html_templates.pl, sub site_html_link:

street_address_url => &encode_map_url ($rec{'Street Address'}),
city_url => &encode_map_url ($rec{'City'}),
state => &encode_map_url ($rec{'State'}),


And this new sub:

# map link mod >
sub encode_map_url {
#-------------------
# Returns correct code for mapquest query.
my ($toencode) = shift;
$toencode =~ s/ /+/g; # Change space to +
$toencode =~ s/#//g; # Remove pound sign
return $toencode;
}
# < map link mod


The pond sign removal is for cases of, for example "suite #3".

Then you need to add these new fields to links.def, including updating your db file with the new fields:

street address
city
state

More detail is in the thread you posted in: http://www.gossamer-threads.com/...i?post=102655#102655


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Linking to Google Maps? In reply to
Did you say you had to many projects to worry about. I sure wish you could code this for me. How can I make it up to you. MapQuest charges $5000 a year to use their maps for commercial ventures. Problem is this>>
We like lots of options listed with the links like here at http://www.magicdirectory.com/...es/Guides/index.html

This would be fun we think. A little audio mike from Evoca along side our "clicktocallme" & "sms me" & our "chat now/not now" (meebo?) & our "IM &/or Video Chat me" button links, >> (Skype, AOL, Yahoo, Google, ICQ, Windows Live Messenger etc.) & our vCard & Hcard buttons & our AddMe buttons, & their free profile page & well , other things as well, pdf me, send to Outlook, , maybe 10 more we have wired. we think having you would be only the rightest thing to do. It'll all be by the listees choice of course. We'll just allow it if they want it. We'll just add links to the services under their listings so they can see them & turn them on if they want. All password pritected of course. How in the world do you code to call all this up? I can do alot of html which some of these are but calling up adresses & names etc. I cannot do. Yet! I visited your site BTW. Here's mine >> www.executivehardwood.com/ Thanks, Gene Cayce
Gene99