+ Start a Discussion
jayesh pagarejayesh pagare 

How do I get (track) the latitude and longitude(location) from mobile device using visualforce?

Andrew EchevarriaAndrew Echevarria
You can enable Geolocation API through Javascript (https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation) and have the Javascript communicate with your Apex Controller
Hi Jayesh,

There is a solution built for this to track current location on Visualforce or Lightning. This is built in LWC but you can use it everywhere.

Link: https://www.playg.app/play/lwc-to-set-geolocation-to-any-object

Lakshay - Playground

Playground is a Salesforce online community to share solutions free of cost that can be used by anyone & with one click deploy technology, it gives hassle-free experience to test these solutions quickly. Check this out at https://playg.app to see existing/upload your solutions