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

· 11년 전 · 3348
 
모바일에서 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년 전 조회 5,081
11년 전 조회 2,987
11년 전 조회 3,820
11년 전 조회 2,182
11년 전 조회 3,222
11년 전 조회 5,878
11년 전 조회 3,030
11년 전 조회 3,227
11년 전 조회 2,134
11년 전 조회 2,435
11년 전 조회 2,884
11년 전 조회 3,010
11년 전 조회 2,901
11년 전 조회 3,620
11년 전 조회 2,559
11년 전 조회 4,493
11년 전 조회 4,653
11년 전 조회 3,195
11년 전 조회 6,137
11년 전 조회 1.1만
11년 전 조회 4,045
11년 전 조회 2,528
11년 전 조회 4,649
11년 전 조회 3,995
11년 전 조회 3,411
11년 전 조회 2,403
11년 전 조회 5,642
11년 전 조회 2,111
11년 전 조회 2,643
11년 전 조회 3,060
11년 전 조회 3,265
11년 전 조회 3,272
11년 전 조회 6,021
11년 전 조회 3,002
11년 전 조회 2,226
11년 전 조회 3,442
11년 전 조회 3,016
11년 전 조회 4,030
11년 전 조회 2,252
11년 전 조회 2,943
11년 전 조회 2,874
11년 전 조회 2,992
11년 전 조회 2,638
11년 전 조회 2,585
11년 전 조회 2,623
11년 전 조회 3,012
11년 전 조회 3,060
11년 전 조회 3,149
11년 전 조회 3,035
11년 전 조회 3,349
11년 전 조회 2,578
11년 전 조회 2,762
11년 전 조회 2,730
11년 전 조회 2,846
11년 전 조회 3,367
11년 전 조회 2,963
11년 전 조회 2,944
11년 전 조회 7,452
11년 전 조회 2,989
11년 전 조회 3,111
11년 전 조회 3,147
11년 전 조회 3,292
11년 전 조회 3,655
11년 전 조회 5,262
11년 전 조회 3,653
11년 전 조회 2,459
11년 전 조회 2,266
11년 전 조회 2,391
11년 전 조회 2,482
11년 전 조회 2,741
11년 전 조회 1.7만
11년 전 조회 2,831
11년 전 조회 1,988
11년 전 조회 2,047
11년 전 조회 2,294
11년 전 조회 4,575
11년 전 조회 2,351
11년 전 조회 2,124
11년 전 조회 2,184
11년 전 조회 2,048
11년 전 조회 2,201
11년 전 조회 2,987
11년 전 조회 1,972
11년 전 조회 2,362
11년 전 조회 3,029
11년 전 조회 1,919
11년 전 조회 2,732
11년 전 조회 2,088
11년 전 조회 2,220
11년 전 조회 2,713
11년 전 조회 2,992
11년 전 조회 1,929
11년 전 조회 2,514
11년 전 조회 1,875
11년 전 조회 5,013
11년 전 조회 2,458
11년 전 조회 2,701
11년 전 조회 2,484
11년 전 조회 1,927
11년 전 조회 2,056