GPS정보 모바일에서 사용하기

· 11년 전 · 3174
 
모바일에서 GPS가져오는 파일입니다.
유용하게 사용하세요 안되시면 쪽지주세요..
구글플레이안산놀이터에 적용된 파일입니다.
 
 
<!DOCTYPE html>
<html>
 <head>
  <title>jQuery Mobile</title>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> 
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> 
<script type='text/javascript' src='/js/jquery-1.7.2.min.js'></script>
<script type='text/javascript' src='/js/jquery.common.js'></script>
<script type='text/javascript' src='/js/swipe.js'></script>
  <meta charset="utf-8" />
  <script>
    var geocoder = new google.maps.Geocoder();
    var addr = "";
   if( navigator.geolocation )
   {
    //괄호 속 인자 ( 성공일 때 함수명, 실패일 때 함수명)
    navigator.geolocation.getCurrentPosition( showPosition, handleError );
   }
   else
   {
    alert('navigator.geolocation 브라우저 미지원');
   }
   function showPosition( position )
   {
    //alert( '위도 : '+position.coords.latitude + '\n경도 : ' + position.coords.longitude );
    googl(position.coords.latitude,position.coords.longitude);
   }
   function handleError( evt )
   {
    alert( evt.message );
   }   
    function googl(num1, num2){
      var latlng = new google.maps.LatLng(num1, num2); 
     
      geocoder.geocode({'latLng': latlng}, function(results, status){
 
     if( status == google.maps.GeocoderStatus.OK ) { 
      //alert(results[0].formatted_address);
  
    //  document.write(results[1].formatted_address);
    //$("#add1").value('111');//results[1].formatted_address); 
    document.body.innerHTML = results[1].formatted_address;
   } 
   else { 
    //document.write("Geocoder failed due to: " + status)
    document.body.innerHTML += "Geocoder failed due to: " + status + "<br />";
    //$("#address").html("Geocoder failed due to: " + status);; 
   } 
  });
}
</script>
</head>
<body>
<!-- <div id="add1" style="font-size:13px;"></div> -->
</body>
</html>

첨부파일

gps.html (1.9 KB) 36회 2014-04-13 00:34
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
11년 전 조회 4,907
11년 전 조회 2,761
11년 전 조회 3,610
11년 전 조회 1,975
11년 전 조회 3,015
11년 전 조회 5,669
11년 전 조회 2,773
11년 전 조회 3,017
11년 전 조회 1,929
11년 전 조회 2,254
11년 전 조회 2,675
11년 전 조회 2,796
11년 전 조회 2,710
11년 전 조회 3,425
11년 전 조회 2,353
11년 전 조회 4,264
11년 전 조회 4,439
11년 전 조회 2,992
11년 전 조회 5,933
11년 전 조회 1.1만
11년 전 조회 3,841
11년 전 조회 2,317
11년 전 조회 4,442
11년 전 조회 3,785
11년 전 조회 3,242
11년 전 조회 2,220
11년 전 조회 5,459
11년 전 조회 1,896
11년 전 조회 2,447
11년 전 조회 2,868
11년 전 조회 3,079
11년 전 조회 3,078
11년 전 조회 5,813
11년 전 조회 2,814
11년 전 조회 2,046
11년 전 조회 3,270
11년 전 조회 2,802
11년 전 조회 3,799
11년 전 조회 2,032
11년 전 조회 2,748
11년 전 조회 2,672
11년 전 조회 2,767
11년 전 조회 2,422
11년 전 조회 2,371
11년 전 조회 2,422
11년 전 조회 2,803
11년 전 조회 2,853
11년 전 조회 2,928
11년 전 조회 2,843
11년 전 조회 3,175
11년 전 조회 2,386
11년 전 조회 2,541
11년 전 조회 2,512
11년 전 조회 2,643
11년 전 조회 3,148
11년 전 조회 2,732
11년 전 조회 2,745
11년 전 조회 7,213
11년 전 조회 2,775
11년 전 조회 2,902
11년 전 조회 2,951
11년 전 조회 3,078
11년 전 조회 3,469
11년 전 조회 5,058
11년 전 조회 3,472
11년 전 조회 2,255
11년 전 조회 2,040
11년 전 조회 2,170
11년 전 조회 2,262
11년 전 조회 2,549
11년 전 조회 1.7만
11년 전 조회 2,650
11년 전 조회 1,766
11년 전 조회 1,791
11년 전 조회 2,088
11년 전 조회 4,398
11년 전 조회 2,148
11년 전 조회 1,930
11년 전 조회 1,974
11년 전 조회 1,852
11년 전 조회 2,027
11년 전 조회 2,827
11년 전 조회 1,766
11년 전 조회 2,182
11년 전 조회 2,853
11년 전 조회 1,722
11년 전 조회 2,575
11년 전 조회 1,925
11년 전 조회 2,064
11년 전 조회 2,528
11년 전 조회 2,807
11년 전 조회 1,755
11년 전 조회 2,323
11년 전 조회 1,696
11년 전 조회 4,871
11년 전 조회 2,269
11년 전 조회 2,544
11년 전 조회 2,306
11년 전 조회 1,751
11년 전 조회 1,885