GPS Coordinates

Posted by meyrick on 26-Jun-2014 01:21

Hi there,

I am currently building an app that will be used by a rep.

Once they have finished their visit at the client they will need to open the app and log their visit.

On the Page Show event, I am wanting to update a local storage variable with the gps coordinates(longitude & latitude).

This data will then write to my database so that I can record every visit to the client to ensure that the rep has actually been there.

Is there a way to do this and if so, how would I do it?

Thanks in advance.

 

Posted by Ricardo Perdigao on 27-Jun-2014 21:36

Hi Meyrick,

Yes, there is a way and it should be fairly simple:

- Create a GeoLocation Service:

-  Map the GPS Coordination to the Local Storage Variables:

- On Page Show fire the GeoLocation Service (mine is called MyLocation) to get the GPS coordinates and store them on the Local Storage Variables:

That should be it!  If you want to store them on the database,  map the Storage Variables to the fields you are sending back to the DB. 

Hope this helps,

Ricardo

All Replies

Posted by Ricardo Perdigao on 27-Jun-2014 21:36

Hi Meyrick,

Yes, there is a way and it should be fairly simple:

- Create a GeoLocation Service:

-  Map the GPS Coordination to the Local Storage Variables:

- On Page Show fire the GeoLocation Service (mine is called MyLocation) to get the GPS coordinates and store them on the Local Storage Variables:

That should be it!  If you want to store them on the database,  map the Storage Variables to the fields you are sending back to the DB. 

Hope this helps,

Ricardo

Posted by meyrick on 30-Jun-2014 08:46

Thank you ricardo! that works perfectly!

This thread is closed