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

· 11년 전 · 3488
 
모바일에서 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,235
11년 전 조회 3,129
11년 전 조회 3,972
11년 전 조회 2,306
11년 전 조회 3,371
11년 전 조회 6,019
11년 전 조회 3,178
11년 전 조회 3,355
11년 전 조회 2,278
11년 전 조회 2,503
11년 전 조회 3,021
11년 전 조회 3,153
11년 전 조회 3,039
11년 전 조회 3,751
11년 전 조회 2,700
11년 전 조회 4,610
11년 전 조회 4,798
11년 전 조회 3,334
11년 전 조회 6,288
11년 전 조회 1.1만
11년 전 조회 4,181
11년 전 조회 2,669
11년 전 조회 4,804
11년 전 조회 4,144
11년 전 조회 3,477
11년 전 조회 2,559
11년 전 조회 5,772
11년 전 조회 2,249
11년 전 조회 2,768
11년 전 조회 3,207
11년 전 조회 3,408
11년 전 조회 3,400
11년 전 조회 6,153
11년 전 조회 3,152
11년 전 조회 2,353
11년 전 조회 3,582
11년 전 조회 3,164
11년 전 조회 4,172
11년 전 조회 2,389
11년 전 조회 3,079
11년 전 조회 3,018
11년 전 조회 3,133
11년 전 조회 2,767
11년 전 조회 2,718
11년 전 조회 2,751
11년 전 조회 3,142
11년 전 조회 3,181
11년 전 조회 3,294
11년 전 조회 3,167
11년 전 조회 3,489
11년 전 조회 2,708
11년 전 조회 2,932
11년 전 조회 2,885
11년 전 조회 2,981
11년 전 조회 3,497
11년 전 조회 3,105
11년 전 조회 3,078
11년 전 조회 7,600
11년 전 조회 3,128
11년 전 조회 3,254
11년 전 조회 3,284
11년 전 조회 3,437
11년 전 조회 3,803
11년 전 조회 5,390
11년 전 조회 3,779
11년 전 조회 2,588
11년 전 조회 2,396
11년 전 조회 2,522
11년 전 조회 2,619
11년 전 조회 2,887
11년 전 조회 1.7만
11년 전 조회 2,967
11년 전 조회 2,121
11년 전 조회 2,169
11년 전 조회 2,421
11년 전 조회 4,695
11년 전 조회 2,506
11년 전 조회 2,264
11년 전 조회 2,328
11년 전 조회 2,182
11년 전 조회 2,324
11년 전 조회 3,127
11년 전 조회 2,107
11년 전 조회 2,522
11년 전 조회 3,183
11년 전 조회 2,080
11년 전 조회 2,877
11년 전 조회 2,224
11년 전 조회 2,364
11년 전 조회 2,844
11년 전 조회 3,127
11년 전 조회 2,067
11년 전 조회 2,674
11년 전 조회 2,017
11년 전 조회 5,153
11년 전 조회 2,611
11년 전 조회 2,836
11년 전 조회 2,627
11년 전 조회 2,080
11년 전 조회 2,198