Açıklama Yok

main.js 579B

12345678910111213141516
  1. $(function(){
  2. $("#currentLocationBtn").click(function(){
  3. if ("geolocation" in navigator){ //check geolocation available
  4. //try to get user current location using getCurrentPosition() method
  5. console.log("current location");
  6. navigator.geolocation.getCurrentPosition(function(position){
  7. console.log("xxxx");
  8. $("#geoText").val(position.coords.latitude+","+position.coords.longitude );
  9. });
  10. }else{
  11. console.log("Browser doesn't support geolocation!");
  12. }
  13. });
  14. });