GeoLocation
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 - 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 + '° <br>Longitude is ' + longitude + '°'; 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);
}
Developer | Katie Inkblotty |
Username | inkblotty |
Uploaded | August 08, 2022 |
Rating | 3 |
Size | 1,752 Kb |
Views | 46,552 |
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!
Name | Size |
React Recipe Box | 13,583 Kb |
Camper News Clone | 3,690 Kb |
Cycling D3 Scatterplot | 4,439 Kb |
Random Quote Generator | 2,980 Kb |
React To Do Task App | 5,564 Kb |
Wiki Search Clone | 4,800 Kb |
Simon game | 5,088 Kb |
Svg path animation | 5,121 Kb |
Star Wars search | 3,521 Kb |
Weather App | 3,881 Kb |
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!
Name | Username | Size |
Under construction | GhostRider | 1,642 Kb |
Scroll to top button | DominicFrancois | 3,743 Kb |
SlideupBoxes | Gavra | 23,772 Kb |
Simple checkbox style | Vncnz | 2,628 Kb |
Mobile Sub Menu Concept | Berdejitendra | 2,790 Kb |
Scroll Arrow | Robooneus | 4,437 Kb |
3D flipping card | Ssaakkaa | 2,238 Kb |
Touch Carousel - last, no gaps. | Berkin | 4,332 Kb |
Animating characters with jQuery | 042 | 2,776 Kb |
Halo 5 REQ Guide Bookmarklet | Cwacht | 3,993 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!