Mobile app version of vmapp.org
Login or Join

Login to follow query

More posts by @Gloria169

1 Comments

Sorted by latest first Latest Oldest Best

 

@Courtney195

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'];

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme