Geolocation in HTML ..
An HTML script that uses your longitude and latitude to find your location in Google Maps by Google Maps API key .. The source code .. < !DOCTYPE html > < html > < head > < title > Geolocation API < / title > < / head > < body > < h2 > Find Your Location in below Map < / h2 > < button onclick = "getlocation();" > Show Position < / button > < div id = "demo" style = "width: 600px; height: 400px; margin-left: 200px;" > < / div > < script src = "https://maps.google.com/maps/api/js?sensor=false" > < / script > < script type = "text/javascript" > function getlocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPos , showErr); } else { alert( "Sorry! your Browser does not support Geolocation API" ) } } // Showing Current Poistion on Google Map function showPos(position) { latt = position.coo...
Comments
Post a Comment