3 Replies Latest reply on Feb 17, 2013 5:58 PM by schamblee

    Need help in creating a dynamic Map Field

    VijayDeodhar

      Title

      Need help in creating a dynamic Map Field

      Post

           I am totally new to Filemaker Pro CRM.  I want to transition from using ACT! CRM to Filemaker.  I would like to find out how to create a dynamic or interactive map field based on the contact address.

           I am quite happy with the basic starter solution Contact Template which does show the Google map but I am unable to zoom in or out or pan that map to see wider surroundings like what I could do that in Act.

           Also, can it have a functionality to generate driving directions.

           I would use this function a lot to understand more about the contact location and driving directions.  Essentially, I will be perfectly happy to see what Google Maps does as long as it can be integrated in this template.

           I am not an IT person.  So, I would greatly appreciate any help in accomplishing this in simple language or instructions.

           Thanks so much in anticipation...

        • 1. Re: Need help in creating a dynamic Map Field
          schamblee

               Look at the contact sample again, in the web viewer the custom function Getmap is used to get the map.  14 is the Zoom level that is passed to the custom function.  You could use a variable in place of the 14 so you could setup buttons to zoom in and out of the map.

               I created a custom function to get the driving directinons, it is not as clean as the Map in a web viewer but it works.

               You need Filemaker Advance to create custom functions:

               here is the function I created

               Let  (
                [
                saddress =  Substitute  (
                      saddress1 & " " &
                      saddress2 & " " &
                      scity & " " &
                      sstate & " " &
                      spostalCode & " " &
                      scountry ;
                      " " ; "+"
                      ) ;

                

                daddress =   Substitute  (
                      daddress1 & " " &
                      daddress2 & " " &
                      dcity & " " &
                      dstate & " " &
                      dpostalCode & " " &
                      dcountry ;
                      " " ; "+"
                      ) ;


                size =   GetLayoutObjectAttribute ( webViewerName ; "width" ) & "x" & GetLayoutObjectAttribute ( webViewerName ; "height" )
                ] ;

                "http://maps.google.com/maps?saddr="
                 & saddres          

                 & "&daddr="

                 &  daddress
                 
                )

               -------------

               The custom web address you use in the 2nd web viewer

               GetDirections( "Map2" ;sAddress1;saddress2;sCity;sState;sZip;sCountry ; dAddress1 ; dAddress2 ; dCity; dState ; dZip; dCountry )

               Note Map2 is the name of the 2nd web viewer

                

                

          • 2. Re: Need help in creating a dynamic Map Field
            VijayDeodhar

                 S. Chamblee:

                 I greatly appreciate your taking time to respond.  Sorry about being ignorant in coding and programming....

                 But exactly from which line to which line of the code you have suggested above needs to be pasted in the code window.  And does this code go right under the existing default code that starts as "GetMap...." OR, does the existing code need to be deleted completely and replaced with this one?

                 Also, I noticed that there is a tiny little button next to the Address 1 line to it's far right side.  If I press that, a new Google Maps window opens and there I can get all the functionalities such as zoom, in/out and directions, etc.  I am not sure what if there is another use to the default Map window that is provided in the starter solution template.

            • 3. Re: Need help in creating a dynamic Map Field
              schamblee

                   You need to create a new function GetDirection and a second WebViewer with GetDirection.  You will have two webviewers, one with a map displaying the location , then a second webviewer will display the Directions.  In the second webviewer you will use GetDirection inplace of the default custom web address.