mitchDig Posted January 31, 2006 Posted January 31, 2006 I saw the following bit of code on a Web site and was wondering if someone would translate it into a FileMaker script? Personally, I would like to use it on a address field that combines all the elements of an address on one line, instead of breaking each element into its own field such as Street, City and Zip. Anyway, I just thought there might be other FileMaker people that would find this very useful. Thanks, Mitch var mapURL = "http://maps.google.com/maps?f=q&hl=en&q="; if (singleResult.address.length > 0) { mapURL += ""; var tmpAddr = singleResult.address.replace(/(s*#.*$)/, ""); mapURL += tmpAddr.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, "+"); } mapURL += "+"; mapURL += "("; mapURL += singleResult.name.replace(/s+/g, "+"); mapURL += ")"; mapURL += "&btnG=Search&"; // t=h is hybrid, t=m is plain map and t=k is satellite map. Change as desired. mapURL += "t=h";
Alex_ND Posted February 9, 2006 Posted February 9, 2006 I do something similar, but not as sophisticated since I'm not much of a coder. But this works for me:
Ted S Posted February 9, 2006 Posted February 9, 2006 Mitch, I'm confused. What are you trying to do? a. Pass address information from FM to Google maps. b. Pull info from Google Maps into FM. c. Just figure out what the code does.
mitchDig Posted February 21, 2006 Author Posted February 21, 2006 Yes, that sums it up pretty well. In a perfect world, I would like to grab address information from a field in FileMaker, then have it go get the map from Google (or another Map site) and place the map in a container field with the least amount of user interaction as possible. Thank you! Mitch P.S. In my case, it needs to work on both Mac and Windows. I'd prefer not to use any plug-ins, but I have the Troi file plug-in.
mitchDig Posted February 21, 2006 Author Posted February 21, 2006 Thank you for this script, I haven't tried it yet but I'm going to give it a spin now. Thanks a lot, Mitch
Recommended Posts
This topic is 6852 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now