Professional Documents
Culture Documents
When you try to retrieve the location using this API, a prompt
is shown to the user, asking them if they’d like to share their
location with your site.
Example of the kind of prompt shown to the user
Obviously, this means that you won’t get the location if the
user decides not to share their location with you.
The output from the code only gives us the coordinates. What
if you need the actual location, or get the address in words?
We’ll talk about this after we discuss IP lookup.
IP Address Lookup
An IP address lookup is another way to get the location of your
visitor. We usually use public IP lookup services/APIs for this
option. Some of these are paid services and some are free.
You can play around with the object to get the desired address
in the format you like best.