GeoLocation

Size
1,752 Kb
Views
46,552

How do I make an geolocation?

What is a geolocation? How do you make a geolocation? This script and codes were developed by Katie Inkblotty on 08 August 2022, Monday.

GeoLocation Previews

GeoLocation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>GeoLocation</title>
</head>
<body>	<div id="location"></div>	<div class="place"></div> <script src="js/index.js"></script>
</body>
</html>

GeoLocation - Script Codes JS Codes

var locateBtn = document.getElementById('locate-btn');
locateBtn.onclick = geoFindMe();
function geoFindMe() { console.log('button press read'); var location = document.getElementById('location');	if(!navigator.geolocation){	location.innerHTML = "<p>Geolocation not supported by your browser</p>"	return;	}	function success(position) {	var latitude = position.coords.latitude;	var longitude = position.coords.longitude;	location.innerHTML = '<p>Latitude is '	+ latitude + '&deg; <br>Longitude is '	+ longitude + '&deg;';	place.innerHTML = '<img src="https://maps.googleapis.com/maps/api/staticmap?center=" + latitude + "," + longitude + "&zoom=13&size=300x300&sensor=false">';	};	function error() {	location.innerHTML = "Unable to retrieve location";	};	location.innerHTML = "<p>Locating...</p>";	navigator.geolocation.getCurrentPosition(success, error);
}
GeoLocation - Script Codes
GeoLocation - Script Codes
Home Page Home
Developer Katie Inkblotty
Username inkblotty
Uploaded August 08, 2022
Rating 3
Size 1,752 Kb
Views 46,552
Do you need developer help for 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!

Katie Inkblotty (inkblotty) Script Codes
Create amazing sales emails 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!