GPS Coordinates - Forum - Mobile - Progress Community

GPS Coordinates

 Forum

GPS Coordinates

This question is answered

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.

 

Verified Answer
  • 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
  • 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

  • Thank you ricardo! that works perfectly!