function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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 ( 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.


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 to see existing/upload your solutions