6 Replies Latest reply on Dec 29, 2014 1:47 PM by schamblee

    Grab GPS location info from 'off form' fields in Contacts database

    andyinnyc

      Title

      Grab GPS location info from 'off form' fields in Contacts database

      Post

      I'm using the Contacts database supplied with FileMaker Pro 13 as a 'Starter Solution'.

      In View, Layout Mode, their appear to be helper fields for use with the mapping function (showing the google map) location.

      The field is "Contacts::Location GPS".  I would like to create fields for lat/long which captures these fields (given an address of the contact) so that I can later perform some 'distance from' calculations.

      I'm a TOTAL filemaker newbie, so please show some pity.

       

      Thanks for the help.

       

      Andrew

        • 1. Re: Grab GPS location info from 'off form' fields in Contacts database
          philmodjunk

          But why can't you use the fields that already have this data? Your calculation field can refer to them in order to compute the distance between two addresses. This will be data in two different records? If so, it's a matter of how you select the pair of contact records for which you want to compute the "straight line" distance.

          • 2. Re: Grab GPS location info from 'off form' fields in Contacts database
            andyinnyc

            Mostly, because I don't know how.  I'm not sure if this is saved with the record and I don't know how to access it to look/test.  I understand the formula for testing distance much better than I understand Filemaker - I've used Access and MySQL, but I've only had Filemaker on the PC for a week.

            How would I 'test' a record to see if this field is saved - it doesn't show up on the included views; again, I'm a complete newbie, but coming up to speed (slowly).

             

            Andrew

            • 3. Re: Grab GPS location info from 'off form' fields in Contacts database
              schamblee

              This field is hidden off the layout because it is used in a script.   This field is global and is set by a command that works only with Filemaker Go.   Global fields would changes across all records, so this would probably not work for calculations.  You can change it from a Global field, which could also change the expected results for the script, then that  would be the a reason to create a new field.  If you don't need the script then it wouldn't matter.  The command used to get  latitude and longitude is Location. http://www.filemaker.com/help/12/fmp/html/func_ref3.33.21.html.

              • 4. Re: Grab GPS location info from 'off form' fields in Contacts database
                andyinnyc

                The Contact form (the offscreen portion) has 'Map from URL container' and 'Reverse Geocoding Address'.

                When a record is pulled up, the address is properly placed on a map - so in practice, the address is being located.

                Can someone point me to the location/steps I need to take to get the coordinates which are being used/stored?

                Andrew

                • 5. Re: Grab GPS location info from 'off form' fields in Contacts database
                  schamblee

                  From my testing the portion off the screen is incomplete.  The options only work partially  from iOS devices, and the scripts that are used to set the fields are also hidden.  The default method to display a map uses a custom function which has nothing to do with the GPS location or Geocoding.  I checked the box next to the scripts so the script show up for use, I also move the field on to the layout so they are visible.   I performed the script to get current location which does return a coordinates that is not correct. I'm in a plaza and I ran the script 3 times, the first two times it gave two different ranges which were incorrect, the third time it gave just a street number but it was also incorrect.  A { was placed in the Geocoding field all 3 times.  I don't have time currently to check this out more.    There were some other websites that had a sample of using Latitude and Longitude but I don't remember for sure which website had it.  Google Maps has also made changes which has caused some of the old techniques not to work any more. That being said here is one website that might help http://filemakerhacks.com/?s=Google+Maps . If this doesn't work then I would suggest doing a google search for Filemaker Google Maps and Geocoding.

                  • 6. Re: Grab GPS location info from 'off form' fields in Contacts database
                    schamblee

                    I have review the database again because of another post.  The scripts are connect to a button Get Current Location that I missed earlier, but I still got bad results, in the fields.