: Can JavaScript be used to obtain real-time GPS location data? Is it possible to access GPS data (Country name, City name, Street name and house number) in real time on a smart phone with
Is it possible to access GPS data (Country name, City name, Street name and house number) in real time on a smart phone with JavaScript?
More posts by @Gloria169
1 Comments
Sorted by latest first Latest Oldest Best
Javascript Geolocation requires special permissions. Chrome used to allow geoloc to be more easily accessible but has since restricted most code from accessing it. Here are a few examples of things you can do:
Here is an example from Google. You need secure origin https, a map api key and likely permissions from client browser:
developers.google.com/maps/documentation/javascript/examples/map-geolocation#try-it-yourself
This JSFiddle uses an API and doesn't require permissions: jsfiddle.net/zK5FN/2/
You can also get the client's IP address through PHP and then run it through something to match the exact location:
$_SERVER['REMOTE_ADDR'];
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.