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

· 11년 전 · 3426
 
모바일에서 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,169
11년 전 조회 3,065
11년 전 조회 3,894
11년 전 조회 2,252
11년 전 조회 3,299
11년 전 조회 5,955
11년 전 조회 3,099
11년 전 조회 3,292
11년 전 조회 2,202
11년 전 조회 2,471
11년 전 조회 2,945
11년 전 조회 3,091
11년 전 조회 2,974
11년 전 조회 3,692
11년 전 조회 2,634
11년 전 조회 4,550
11년 전 조회 4,728
11년 전 조회 3,273
11년 전 조회 6,231
11년 전 조회 1.1만
11년 전 조회 4,116
11년 전 조회 2,606
11년 전 조회 4,726
11년 전 조회 4,080
11년 전 조회 3,447
11년 전 조회 2,496
11년 전 조회 5,704
11년 전 조회 2,185
11년 전 조회 2,710
11년 전 조회 3,137
11년 전 조회 3,344
11년 전 조회 3,342
11년 전 조회 6,098
11년 전 조회 3,080
11년 전 조회 2,293
11년 전 조회 3,512
11년 전 조회 3,091
11년 전 조회 4,093
11년 전 조회 2,322
11년 전 조회 3,016
11년 전 조회 2,944
11년 전 조회 3,076
11년 전 조회 2,709
11년 전 조회 2,664
11년 전 조회 2,691
11년 전 조회 3,071
11년 전 조회 3,129
11년 전 조회 3,232
11년 전 조회 3,106
11년 전 조회 3,427
11년 전 조회 2,648
11년 전 조회 2,857
11년 전 조회 2,804
11년 전 조회 2,926
11년 전 조회 3,429
11년 전 조회 3,040
11년 전 조회 3,030
11년 전 조회 7,522
11년 전 조회 3,067
11년 전 조회 3,192
11년 전 조회 3,229
11년 전 조회 3,360
11년 전 조회 3,744
11년 전 조회 5,335
11년 전 조회 3,719
11년 전 조회 2,518
11년 전 조회 2,332
11년 전 조회 2,459
11년 전 조회 2,554
11년 전 조회 2,823
11년 전 조회 1.7만
11년 전 조회 2,911
11년 전 조회 2,055
11년 전 조회 2,114
11년 전 조회 2,361
11년 전 조회 4,630
11년 전 조회 2,426
11년 전 조회 2,202
11년 전 조회 2,253
11년 전 조회 2,106
11년 전 조회 2,262
11년 전 조회 3,052
11년 전 조회 2,036
11년 전 조회 2,451
11년 전 조회 3,107
11년 전 조회 1,988
11년 전 조회 2,802
11년 전 조회 2,154
11년 전 조회 2,290
11년 전 조회 2,768
11년 전 조회 3,058
11년 전 조회 1,993
11년 전 조회 2,595
11년 전 조회 1,945
11년 전 조회 5,083
11년 전 조회 2,535
11년 전 조회 2,748
11년 전 조회 2,548
11년 전 조회 1,993
11년 전 조회 2,126