3 Replies Latest reply on Aug 14, 2013 8:21 PM by schamblee

    google maps

    pv

      Title

      google maps

      Post

      The following is a post I pasted here from 2 years ago, it works great, but I only want to plot points for my addresses, not get driving directions to each one.  I've tried taking out (d&saddr), all together & bits & pieces of it, but can't figure it out.

      Also, are there other options, like zoom level, window size,...

      How do I keep it in my filemaker program instead of opening in a browser?

       

      Thanks

       

       

      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

        • 1. Re: google maps
          braxton

          This is a great morsel of code to plot a single address.  If you need more plots you might play with it and figure that out.  Add a Web Viewer in Layout mode, double click opening the Web Viewer dialog box, click Specify... for web address, and drop in the following code and replace the values in green with your own.

           

          "data:text/html,<style type='text/css'>html,body{overflow:hidden;}</style><html><head><title>NavText</title><head><bodybgcolor='#FFFFFF'TopMargin='10'style='border:0'><iframe width='"&GetLayoutObjectAttribute ("web";"width")-18&"'height='"&GetLayoutObjectAttribute("web";"height")-18&"'frameborder='0' scrolling='no'marginheight='0'marginwidth='0'src='http://local.google.com/maps?q="&clients::address&"+"&clients::city&"+"&clients::state&"+"&clients::zip&"&amp;output=embed&iwloc=0'></iframe></body></html>"

          • 2. Re: google maps
            malibux14x

                 i have been trying to figure this out for a few hours now.  :/

                 can you explain what this means exactly:

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

                 is it a set variable? 

                 thanks

            • 3. Re: google maps
              schamblee

                   Here is a post of a sample that I created in FMP12  Google Maps Pin Solution

                    

                   I don't have fmp11 and I have already used up my trail days for fmp11. You download a trail version of 12.  I have two calculation. 

                    

                   first unstored calculation filed "url"

                   Let (
                    [
                    address = Substitute (
                   Daddress & " " &
                   ""& " " &
                   Dcity & " " &
                   Dstate& " "&
                   Dzip& " " &
                    " " ;
                    " " ; "+"
                    ) ;
                    size = GetLayoutObjectAttribute ( "Map1" ; "width" ) & "x" & GetLayoutObjectAttribute ("Map1" ; "height" )
                    ] ;
                    
                   "http://maps.google.com/maps/api/staticmap?center="
                    & address &
                    "&zoom=" & 12 &
                    "&markers="
                    & TheMarker &
                    "&size="
                    & size &
                    "&sensor=false"
                    )

                    

                   second unstored calculation field "TheMaker"

                   If(Pin="Yes";
                   "&markers=" & " " &
                   Daddress & " " &
                    ""& " " &
                   Dcity & " " &
                   Dstate & " " &
                   Dzip & " " &
                    "";"")