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 (https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation) and have the Javascript communicate with your Apex Controller
lkatneylkatney
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

Thanks
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