Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Use Google Maps with the People widget' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use Google Maps with the People widget
Authored by: capacity on Jan 16, '06 04:40:29PM
To make clicking on the person's address search for that person in Google's Residential Phonebook rather than just going to a map of the address associated with that person as the originally posted code does, use this chunk of code:

// Search Google's Residential Phonebook
var mapURL = "http://www.google.com/search?sa=X&oi=fwp&pb=f&q=";
mapURL += singleResult.firstname.replace(/\s+/g, "+");
mapURL += "+";
mapURL += singleResult.lastname.replace(/\s+/g, "+");
mapURL += "+";
mapURL += singleResult.city.replace(/\s+/g, "+");
mapURL += "+";
mapURL += singleResult.state.replace(/\s+/g, "+");
if (singleResult.zip.length > 0)
    {
	mapURL += "+";
	mapURL += singleResult.zip.replace(/\s+/g, "+");
    }
Note: After every
 .replace( 
there is a forward slash, back slash, s, plus sign, forward slash, g, comma, double quote, plus sign, double quote, end parentheses, and semicolon.

Clicking the person's name will go to their daplus.us entry. I don't know Java Script very well, but I would assume that if someone wanted to they could have the widget search and return data from Google's Residential Phonebook, have clicking on the name show Google's Residential Phonebook result, and have clicking on the address plot a map.

[ Reply to This | # ]