1function getUserLocation() { 2 if (navigator.geolocation) { 3 navigator.geolocation.getCurrentPosition(showLocationPosition, showLocationError); 4 } else { 5 console.log("Geolocation is not supported by this browser."); 6 } 7} 8 9function showLocationPosition(position) { 10 const contactPage = $("#contactForm"); 11 if (contactPage != null) { 12 var latElement = document.getElementById("ContactForm_UserLocationLat"); 13 var lonElement = document.getElementById("ContactForm_UserLocationLon"); 14 15 if (latElement != null) 16 latElement.value = position.coords.latitude.toString().replace(".", ","); 17 18 if (lonElement != null) 19 lonElement.value = position.coords.longitude.toString().replace(".", ","); 20 } 21} 22 23function showLocationError(error) { 24 if (error.code == 1) 25 console.log("User denied the request for Geolocation."); 26 else if (err.code == 2) 27 console.log("Location information is unavailable."); 28 else if (err.code == 3) 29 console.log("The request to get user location timed out."); 30 else 31 console.log("An unknown error occurred."); 32}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.