4 Replies Latest reply on Sep 18, 2014 11:23 AM by schamblee

    Use GetMap function with updated field names?

    JustinKaiser

      Title

      Use GetMap function with updated field names?

      Post

      I’m using the FM 13 contacts starter solution as a starting point to build my own contacts database. I'm using FM 13 Advanced.

      I’ve set up my new Mailing Address fields like this:

      Address 1 Street
      Address 1 Street 2
      Address 1 City

      Address 2 Street
      Address 2 Street 2
      Address 2 City

      Address 3 Street
      Address 3 Street 2
      Address 3 City

      Unfortunately, I've lost the map generating functionality when I changed the field names for my mailing addresses. I can’t get the custom GetMap function to work correctly with my new field names.

      Even after reading the thread here (GetMap Function in FMP 12 Contacts) I’m still stumped.

      The attached screenshot shows how I’ve updated the parameters of the GetMap function to with my new Address field names.

       

      However when I put this same function in a calculated field, the result is: 

      http://maps.google.com/maps/api/staticmap?center=Address 1 Street+Address 1 Street 2+Address 1 City+Address 1 State+Address 1 Zip+Address 1 Country&&sensor=falsezoom=14&markers=Address 1 Street+Address 1 Street 2+Address 1 City+Address 1 State+Address 1 Zip+Address 1 Country&size=331x343&maptype=roadmap

      The function seems to be evaluating the field names as text, not pulling the data from the fields.

      In layout view the Web Viewer doesn't appear at all.  No empty box or anything.

      I have filemaker Pro Advanced and have looked at the details in the custom function, and even in there it seems that every thing should be working correctly. Though, I do confess, I don’t completely understand everything that’s going on in there.

      Any Ideas on how I can get the GetMap custom function to work with my new field names?

      Thanks for any help. :)

      Screen_Shot_2014-09-18_at_9.29.11_AM.png

        • 1. Re: Use GetMap function with updated field names?
          schamblee

          GetMap is not a built in function, it is a custom function.  Did you copy the custom function from the starter solution to your new database.   FMA 13 is required to create custom functions. Goto File, Manage, Custom Functions, then Import.

          Did you name your web viewer map1?

          • 2. Re: Use GetMap function with updated field names?
            philmodjunk

            And note that your call of the GetMap function only refers to the original fields, not the new ones that you have added. You'll need to modify the calculation in the Web Address box if you want to use address data in your new fields.

            • 3. Re: Use GetMap function with updated field names?
              JustinKaiser

              Thank you both of the responses. I am building off of the starter solution or adapting it to my needs. So that is how I have access to the custom function. I'm not was a good idea or not. Maybe it would have been better to start from scratch? The image above does show the correct (custom) field names.

              At any rate I did get the map to finally start working by making sure that the object name for the Web Viewer was the same as the name parameter in the custom GetMap function (Map1, Map2, Map3 ....). This seems odd because the the web viewer objects that display the map in the starter solution don't have object names and they work correctly.

              • 4. Re: Use GetMap function with updated field names?
                schamblee

                 The Web Viewers in the Starter solution are named.  The web viewer is grouped with other objects, so it looks like it is not name. You have to ungroup the web viewer to see the name. Right click on the web viewer in the starter solution then click arrange, then click ungroup.  Once ungrouped you can click on the web viewer and see the name in the inspector.