Reminder about Geolocation

Developer
Size
1,875 Kb
Views
20,240

How do I make an reminder about geolocation?

Snippet taken from https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation to remind me how to access GeoLocation properties of a browser.. What is a reminder about geolocation? How do you make a reminder about geolocation? This script and codes were developed by JR Jenkins on 04 October 2022, Tuesday.

Reminder about Geolocation Previews

Reminder about Geolocation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Reminder about Geolocation</title>
</head>
<body> <p><button onclick="geoFindMe()">Show my location</button></p>
<div id="out"></div> <script src="js/index.js"></script>
</body>
</html>

Reminder about Geolocation - Script Codes JS Codes

function geoFindMe() { var output = document.getElementById("out"); if (!navigator.geolocation){ output.innerHTML = "<p>Geolocation is not supported by your browser</p>"; return; } function success(position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; output.innerHTML = '<p>Latitude is ' + latitude + '° <br>Longitude is ' + longitude + '°</p>'; var img = new Image(); img.src = "https://maps.googleapis.com/maps/api/staticmap?center=" + latitude + "," + longitude + "&zoom=13&size=300x300&sensor=false"; output.appendChild(img); }; function error() { output.innerHTML = "Unable to retrieve your location"; }; output.innerHTML = "<p>Locating…</p>"; navigator.geolocation.getCurrentPosition(success, error);
}
Reminder about Geolocation - Script Codes
Reminder about Geolocation - Script Codes
Home Page Home
Developer JR Jenkins
Username jrjenk
Uploaded October 04, 2022
Rating 3
Size 1,875 Kb
Views 20,240
Do you need developer help for Reminder about Geolocation?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

JR Jenkins (jrjenk) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!