HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Get the latitude and longitude of the user's position
The geolocation
property returns a Geolocation object that can be used to
locate the user's position.
The geolocation
property is read-only.
The geolocation
property is only available in secure contexts (HTTPS).
The geolocation
property is only available if the user approves it.
Geolocation is much more accurate for devices with GPS, like smartphones.
Type | Description |
An object | A reference to a Geolocation object. |
navigator.geolocation
is supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |