1 2 Previous Next 23 Replies Latest reply on Jan 21, 2017 11:35 AM by JackRodges

    GPS Co Ordinations

    supportme

      Hi there All

       

      Has anyone captured lately the GPS co ordinates of your Phone or iPad and put the Lon/Lat details into a filemaker field/s. (Maybe something like...click a button, DateJobCompleted (Auto Entered), SENDeMail, GET GPS Co Ordinates)

       

      My staff on the road will need to close off Jobs as they go (that part is working), My manger came up with a brain wave idea, that when they close the job, "Can We Get the GPS Co ordinates", then if need be, display in a Web Viewer where the actual sign off occured. We would like to think that the Job was closed at the "location" and not at the "Pub"

       

      I have looked through here (the community), Some of the posts are old or links on them are not working.

      If this is do able... could you display the details

       

      Thanks for your help

       

      Tim

      Australia

        • 1. Re: GPS Co Ordinations
          arthursc

          I have no answer, but I am considering something simular and would be interested in the answer also.

           

          ArthursC

          • 2. Re: GPS Co Ordinations

            There is a good article on Geo Location at http://www.supportgroup.com/explore/geolocation-with-filemaker-go/ which includes some sample HTML for use in the web viewer

            • 3. Re: GPS Co Ordinations
              pthomas

              That is a very useful article, I used it a while back to implement the ability to capture the GPS location in our iPad application.

               

              In summary, I have the following set up:

               

              3 fields in my menu table:

              Geolocation - Text

              Latitudeg - Text

              Longitudeg - Text

               

              Geolocation is set to:

               

              <!DOCTYPE HTML>

              <html>

              <head>

              <script type="text/javascript">

              function handler(location) {

              var message = document.getElementById("messageArea");

              messageArea.innerHTML="<p>Latitude: " + location.coords.latitude + "</p>";

              messageArea.innerHTML+="<p>Longitude: " + location.coords.longitude + "</p>";

              messageArea.innerHTML+="<p>Accuracy: " + location.coords.accuracy + "</p>";

              }

               

              function fail() {

              var message = document.getElementById("messageArea");

              messageArea.innerHTML="<p>Can't get located</p>"

              }

               

              function getLocation() {

              navigator.geolocation.watchPosition(handler,fail,{maximumAge: 5000, enableHighAccuracy: true, timeout: 30000});

              }

               

              </script>

              </head>

              <body onload="getLocation();">

              <div id="messageArea">

              Location unknown

              </div>

              </body>

              </html>

               

              Latitudeg and Longitudeg are both set via a script.

               

              I then placed a web viewer (1px by 1px so it doesn't display as I don't want the users to see it) on my menu layout.

              The web viewer is named "WebViewer" and set to the following web address:

               

              "data:text/html," &

              Menu::GeoLocation

               

              I then have a button on our client layout that runs the following script:

               

              Go to Layout ["Main Menu" (Menu)]

              Set Web Viewer [Object Name: "WebViewer"; Action ; Reset]

              Pause/Resume Script [Duration (seconds): 3]

              Set Field [Menu::Latitude;

               

              Let (
              [
                $W = GetLayoutObjectAttribute ( "WebViewer" ; "Content" ) ;
                $P = Position ( $W ; "Latitude: " ; 1 ; 2 ) ;
                $S = $P + 10 ;
                $E = Position ( $W ; "<" ; $P ; 1 ) ;
                $N = $E - $S
              ] ;
              Middle ( $W ; $S ; $N )
              )

              Set Field [Menu::Longitude;

               

              Let (
              [
                $W = GetLayoutObjectAttribute ( "WebViewer" ; "Content" ) ;
                $P = Position ( $W ; "Longitude: " ; 1 ; 2 ) ;
                $S = $P + 11 ;
                $E = Position ( $W ; "<" ; $P ; 1 ) ;
                $N = $E - $S
              ] ;
              Middle ( $W ; $S ; $N )
              )

              Go to Layout ["Clients" (Clients)]

              Open URL [No Dialogue;

              "http://maps.google.com/maps?daddr=" & Clients::Street_No & "+" & Clients::Street_Name & "+" & Clients::Street_Typ & "+" & Clients::Location Town & "+" & Clients::Location State & "&saddr=" & Menu::Latitudeg & ",+" & Menu::Longitudeg]

               

               

              That last line of the script plots a course from the iPads currently location to the clients address in google maps which was a requirement for us but probanly not needed for what you are after.

               

              Hope this helps!

               

              Cheers,

               

              Paul.

              • 4. Re: GPS Co Ordinations
                arthursc

                Paul

                 

                Thank you do much for your contribution. I may take you up on some help down the line as my requirement is slightly different but does involve tagging a/many spots for plotting records etc.

                 

                Regards

                Colin

                 

                Sent from my iPhone

                • 5. Re: GPS Co Ordinations
                  supportme

                  Thanks Paul, i have had a look through this and will have a go at setting it up, I'll get back to you if i have any problems

                   

                   

                  Tim

                  • 6. Re: GPS Co Ordinations
                    supportme

                    Hi Paul

                     

                    I have run up a test of this following your lead....

                    On the iphone

                    1. Im showing the

                    <!DOCTYPE HTML>

                    <html>

                    <head>

                    2. I have the Longitude and Lattitude fields displayed

                    3. The Web Viewer

                     

                    In the Web viewer, is displayed the Lattitude (-35.34339), Longitude (149.248123) and accuracy (97.5356), no MAP pin pointing the location just the text detail


                    Should the script set the fields Longitude and Lattitude with the above numbers?? cause there is nothing in the fields. Have I missed something here.

                     

                    Then if the script sets the 2 fields, How do I display a Google map with the Longitude and Lattitude

                     

                    Tim



                    • 7. Re: GPS Co Ordinations
                      arthursc

                      Paul,

                       

                      So what if you want to locate several GPS locations i.e let say you plotting sighting of animals or birds and over a period of time you have tagged the GPS locations. You now want to plot all of these locations onto a google map. How could you do this?

                       

                      Regards

                      ArthursC

                      • 8. Re: GPS Co Ordinations
                        pthomas

                        Hi Tim,

                         

                        Have you also set up the script that sets the Longitude and Latitude fields using the Let statements from my previous post?

                         

                        You may need to step through that script with the debugger and see if it is having trouble interpreting the latitude and longitude values from the web viewer (possibly the web viewer is returning slightly different results for you because of your location so my script may need to be tweaked to work for you).

                         

                        Once you do have the Latitude and Longitude stored in those fields, issuing an Open URL command with the following syntax should show that location in google maps:

                         

                        "http://maps.google.com/maps?q=" & Menu::Latitude & ",+" & Menu::Longitude

                         

                        Cheers,

                         

                        Paul.

                        • 9. Re: GPS Co Ordinations
                          pthomas

                          Hi ArthusC,

                           

                          From my research it looks like google maps doesn't support plotting multiple points into a map, it can only take one at a time.

                           

                          You could have a look at: http://www.gpsvisualizer.com/map_input as that will apparently allow you to upload a file with GPS tags in it and then plot them all, but I am not sure if you would be able to automate that upload process or not.

                           

                          Cheers,

                           

                          Paul.

                          • 10. Re: GPS Co Ordinations
                            arthursc

                            Hi Paul,

                             

                            I will investigate further with our google api guys as I am fairly sure you can drop multiple pins to a map. Watch this space.

                             

                            Regards

                            ArthursC

                            • 11. Re: GPS Co Ordinations
                              supportme

                              Hi Paul

                               

                              I added to your script a COMMIT and extended the PAUSE time and RECORD DUPLICATE

                              This put the Latitude and Longitude into the Fields

                               

                              I then made a new Web Viewer with

                              "http://local.google.com/maps?" & "q=" & GPS_Location::Latitudeg &" , "& GPS_Location::LongitutdeG

                              Similar to what you just sent me

                               

                              As for testing you need to test on the iphone as the desktops don't have the GPS nothing realy works

                               

                              Having said that on the iPhone, You can click on the BUTTON, the last record is duplicated and Latitude and Longitude fields are cleared, then after the set delay, the Latitude and Longitude fields are populated with the GPS co ordinates,

                              go to the second Web viewer, and the Location is Displayed.

                               

                              I used Duplicate Record as your first part

                              <!DOCTYPE HTML>

                              <html>

                              <head>

                              is over 255 characters for an auto entry on NEW record

                              So thanks very much for your help

                              Paul what you sent me is the correct answer, (Im going to tick that) however others reading this may have to do some tweaking to get it to do what they want.

                              Again thank you

                               

                              Tim

                              Australia

                              • 12. Re: GPS Co Ordinations
                                pthomas

                                Hi Tim,

                                 

                                Glad you got a solution up and running!

                                 

                                One thing to consider is storing the large field in some sort of central table (I use my menu table personally which only has 1 record in it) and just reference it from there so you don't need to store it in every record.

                                 

                                You may need to set up a new relationship from your current table back to the central table though.

                                 

                                Or you could look at setting it up as a global field so once again you only need to store the value once, not in every single record.

                                 

                                Cheers,

                                 

                                Paul.

                                • 13. Re: GPS Co Ordinations
                                  databuzz

                                  Hi ArthursC,

                                   

                                  I haven't tried this on FileMaker Go but you can certainly plot multiple locations onto a Google Map using the Maps API. Once you have the Goecodes of each location you can use the Maps API to create a map with multiple markers. I've done this for a number of clients recently (using FileMaker Pro) and it works quite well.

                                   

                                  HTH,

                                  Andrew

                                   

                                  FileMaker 8/9/10/11 Certified Developer

                                  Databuzz

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

                                  Phone: +61 2 9484 6565

                                  Mobile: +61 418 468 103

                                  Email: andrew@databuzz.com.au

                                  Web: www.databuzz.com.au

                                  • 14. Re: GPS Co Ordinations
                                    Grace

                                    Hi Andrew,

                                     

                                    How did you use the Google Map API to show multiple locations without showing the routes connecting them? I have Geocodes of each location. I just want to show them on maps.

                                     

                                    Thank you,

                                    Grace

                                    1 2 Previous Next