🔷 About HTML Geolocation API - 1 A Thread🧵 👇

📌 HTML Geolocation API → The HTML Geolocation API is used to locate a user's position. ♦️ Locate the user's position → The HTML Geolocation API is used to get the geographical position of a user.

→ Since this can compromise privacy, the position is not available unless the user approves it. ⛔ Note:-Geolocation is most accurate for devices with GPS, like smartphones.

📌 Using HTML Geolocation → The getCurrentPosition() method is used to return the user's position. → The example below returns the latitude and longitude of the user's position.

⛔ Example explained:- → Check if Geolocation is supported If supported, run the getCurrentPosition() method. → If not, display a message to the user.

→ If the getCurrentPosition() method is successful, it returns a coordinates object to the function specified in the parameter (showPosition). → The showPosition() function outputs the Latitude and Longitude → The example above is a very basic.

→ Geolocation script, with no error handling.

Thanks for reading this thread ❤️ If you like it , make sure you: 🔷 Like the tweet 🔷 Retweet the first tweet ⚡ For more content , follow: @MrunayU