3 Replies Latest reply on Mar 23, 2010 5:43 PM by pv

    Creating a script to open single/multiple addresses in google maps

    constructive2003

      Title

      Creating a script to open single/multiple addresses in google maps

      Post

      Greetings All

       

      Does anyone know how to get from a list of addresses (3-4 max) in FM Pro to a scripted button that produces a google map with these addresses plotted?

       

      Would be greatful for any advice.

       

        • 1. Re: Creating a script to open single/multiple addresses in google maps
          wallywam1
            

          I'm assuming you meant Google Maps via the Web and driving directions for all of the locations mapped. I just set this up and tested for 1 to 4 addresses. Here's how it works:

           

          First you need a database with a table that has an address field and a sorting field.

          Create a list layout with the 2 fields.

          Find all the addresses that you want to include in the map. Use the sort field to specify the order.

          An Open Map script should do the following:

           

          Sort the records according to the sort field

          Set variable $URL to "http://maps.google.com/maps?d&saddr="  & Substitute ( Address::Address; " "; "+")

          [note: saddr is the start address]

          Loop through remaining records...

          Go to next record (exit after last)

          Set $URL & "+to:"  & Substitute ( Address::Address; " "; "+")

          [note: +to: denotes all additional addresses]

          End loop.

          Open URL (No Dialog), $URL

           

          As I said, I actually created a small database and script and it all works, so if anything is unclear, please let me know.

          • 2. Re: Creating a script to open single/multiple addresses in google maps
            Staniw
              

            Hi!

            when I did create the script the only generates link to the last address in the database....

            any asuggestions ?

             

            regards

             

             

             

            First you need a database with a table that has an address field and a sorting field.

            Create a list layout with the 2 fields.

            Find all the addresses that you want to include in the map. Use the sort field to specify the order.

            An Open Map script should do the following:

             

            Sort the records according to the sort field

            Set variable $URL to "http://maps.google.com/maps?d&saddr="  & Substitute ( Address::Address; " "; "+")

            [note: saddr is the start address]

            Loop through remaining records...

            Go to next record (exit after last)

            Set $URL & "+to:"  & Substitute ( Address::Address; " "; "+")

            [note: +to: denotes all additional addresses]

            End loop.

            Open URL (No Dialog), $URL

            • 3. Re: Creating a script to open single/multiple addresses in google maps
              pv

              what do I need to change to just plot the addresses, without the driving directions?

               

              are there other commands to set the zoom level, view, ...

               

              can I get this to open in a filemaker web viewer page, or must it open in its own browser window

               

              thanks