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: rbjorensen on Jan 16, '06 09:06:40AM

I had the same issue. Value "s" being replaced with + in the url. I'm no programming guy, but I fixed it by changing the "+" in the lines below to "s".

Replaced these lines:
mapURL += tmpAddr.replace(/s+/g, "+");
mapURL += singleResult.city.replace(/s+/g, "+");
mapURL += singleResult.state.replace(/s+/g, "+");
mapURL += singleResult.zip.replace(/s+/g, "+");
mapURL += singleResult.firstname.replace(/s+/g, "+");
mapURL += singleResult.lastname.replace(/s+/g, "+");

With these lines:
mapURL += tmpAddr.replace(/s+/g, "s");
mapURL += singleResult.city.replace(/s+/g, "s");
mapURL += singleResult.state.replace(/s+/g, "s");
mapURL += singleResult.zip.replace(/s+/g, "s");
mapURL += singleResult.firstname.replace(/s+/g, "s");
mapURL += singleResult.lastname.replace(/s+/g, "s");

I could probably just remove everything past .replace except the ;

Like I said, I'm not familiar with the .js, but I know kind of what these are doing. It's taking mapURL and adding text to the mapURL variable and replacing the string s+ with + originally. Now, I've changed it to replace s+ with s just to get it working. I know this isn't the best, because I'm sure that string is being replaced for some reason, but I don't think it was intended to replace just s with a +. He got more than he asked for with the replace.

As for the zip, the zip code get transposed into a city, state. It doesn't become part of the url.

Anyway, it's a fix until the author can tell us how to really do it. I just know it works for me right now.




[ Reply to This | # ]
10.4: Use Google Maps with the People widget
Authored by: rbjorensen on Jan 16, '06 09:23:37AM

Like I suspected, removing everything past .replace except for ; does it too:

Instead of this:
mapURL += tmpAddr.replace(/s+/g, "s");
mapURL += singleResult.city.replace(/s+/g, "s");
mapURL += singleResult.state.replace(/s+/g, "s");
mapURL += singleResult.zip.replace(/s+/g, "s");
mapURL += singleResult.firstname.replace(/s+/g, "s");
mapURL += singleResult.lastname.replace(/s+/g, "s");

You can use this:
mapURL += tmpAddr;
mapURL += singleResult.city;
mapURL += singleResult.state;
mapURL += singleResult.zip.replace;
mapURL += singleResult.firstname;
mapURL += singleResult.lastname;

But, like I said, there must be some reason he had the s+ string replacement in there. He just didn't mean to replace all "s". Let us know.

Thx.



[ Reply to This | # ]