Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6852 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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";

  • 2 weeks later...
Posted

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.

  • 2 weeks later...
Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.