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

· 11년 전 · 3582
 
모바일에서 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,319
11년 전 조회 3,204
11년 전 조회 4,050
11년 전 조회 2,393
11년 전 조회 3,457
11년 전 조회 6,108
11년 전 조회 3,266
11년 전 조회 3,434
11년 전 조회 2,377
11년 전 조회 2,542
11년 전 조회 3,115
11년 전 조회 3,275
11년 전 조회 3,125
11년 전 조회 3,857
11년 전 조회 2,815
11년 전 조회 4,701
11년 전 조회 4,891
11년 전 조회 3,424
11년 전 조회 6,391
11년 전 조회 1.1만
11년 전 조회 4,277
11년 전 조회 2,772
11년 전 조회 4,890
11년 전 조회 4,247
11년 전 조회 3,507
11년 전 조회 2,654
11년 전 조회 5,870
11년 전 조회 2,345
11년 전 조회 2,870
11년 전 조회 3,294
11년 전 조회 3,507
11년 전 조회 3,483
11년 전 조회 6,253
11년 전 조회 3,265
11년 전 조회 2,448
11년 전 조회 3,673
11년 전 조회 3,263
11년 전 조회 4,273
11년 전 조회 2,470
11년 전 조회 3,156
11년 전 조회 3,104
11년 전 조회 3,229
11년 전 조회 2,850
11년 전 조회 2,804
11년 전 조회 2,837
11년 전 조회 3,219
11년 전 조회 3,275
11년 전 조회 3,378
11년 전 조회 3,242
11년 전 조회 3,583
11년 전 조회 2,804
11년 전 조회 3,020
11년 전 조회 2,960
11년 전 조회 3,076
11년 전 조회 3,579
11년 전 조회 3,189
11년 전 조회 3,170
11년 전 조회 7,680
11년 전 조회 3,224
11년 전 조회 3,335
11년 전 조회 3,345
11년 전 조회 3,530
11년 전 조회 3,883
11년 전 조회 5,464
11년 전 조회 3,870
11년 전 조회 2,690
11년 전 조회 2,483
11년 전 조회 2,606
11년 전 조회 2,731
11년 전 조회 2,994
11년 전 조회 1.7만
11년 전 조회 3,058
11년 전 조회 2,209
11년 전 조회 2,252
11년 전 조회 2,517
11년 전 조회 4,801
11년 전 조회 2,590
11년 전 조회 2,359
11년 전 조회 2,433
11년 전 조회 2,270
11년 전 조회 2,440
11년 전 조회 3,233
11년 전 조회 2,193
11년 전 조회 2,622
11년 전 조회 3,278
11년 전 조회 2,189
11년 전 조회 2,961
11년 전 조회 2,315
11년 전 조회 2,454
11년 전 조회 2,933
11년 전 조회 3,223
11년 전 조회 2,158
11년 전 조회 2,766
11년 전 조회 2,111
11년 전 조회 5,234
11년 전 조회 2,706
11년 전 조회 2,913
11년 전 조회 2,736
11년 전 조회 2,160
11년 전 조회 2,287