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

· 11년 전 · 3313
 
모바일에서 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,039
11년 전 조회 2,935
11년 전 조회 3,764
11년 전 조회 2,137
11년 전 조회 3,165
11년 전 조회 5,837
11년 전 조회 2,962
11년 전 조회 3,175
11년 전 조회 2,086
11년 전 조회 2,422
11년 전 조회 2,832
11년 전 조회 2,967
11년 전 조회 2,858
11년 전 조회 3,575
11년 전 조회 2,497
11년 전 조회 4,443
11년 전 조회 4,600
11년 전 조회 3,145
11년 전 조회 6,094
11년 전 조회 1.1만
11년 전 조회 4,009
11년 전 조회 2,486
11년 전 조회 4,599
11년 전 조회 3,942
11년 전 조회 3,406
11년 전 조회 2,362
11년 전 조회 5,590
11년 전 조회 2,068
11년 전 조회 2,605
11년 전 조회 3,017
11년 전 조회 3,220
11년 전 조회 3,242
11년 전 조회 5,980
11년 전 조회 2,956
11년 전 조회 2,186
11년 전 조회 3,403
11년 전 조회 2,969
11년 전 조회 3,980
11년 전 조회 2,199
11년 전 조회 2,881
11년 전 조회 2,831
11년 전 조회 2,947
11년 전 조회 2,586
11년 전 조회 2,529
11년 전 조회 2,574
11년 전 조회 2,961
11년 전 조회 3,005
11년 전 조회 3,098
11년 전 조회 2,990
11년 전 조회 3,314
11년 전 조회 2,537
11년 전 조회 2,716
11년 전 조회 2,675
11년 전 조회 2,803
11년 전 조회 3,322
11년 전 조회 2,914
11년 전 조회 2,891
11년 전 조회 7,408
11년 전 조회 2,953
11년 전 조회 3,072
11년 전 조회 3,098
11년 전 조회 3,240
11년 전 조회 3,606
11년 전 조회 5,214
11년 전 조회 3,603
11년 전 조회 2,423
11년 전 조회 2,206
11년 전 조회 2,342
11년 전 조회 2,433
11년 전 조회 2,700
11년 전 조회 1.7만
11년 전 조회 2,801
11년 전 조회 1,936
11년 전 조회 1,986
11년 전 조회 2,236
11년 전 조회 4,527
11년 전 조회 2,301
11년 전 조회 2,094
11년 전 조회 2,139
11년 전 조회 2,009
11년 전 조회 2,168
11년 전 조회 2,943
11년 전 조회 1,926
11년 전 조회 2,321
11년 전 조회 2,988
11년 전 조회 1,878
11년 전 조회 2,701
11년 전 조회 2,050
11년 전 조회 2,189
11년 전 조회 2,666
11년 전 조회 2,946
11년 전 조회 1,895
11년 전 조회 2,480
11년 전 조회 1,828
11년 전 조회 4,982
11년 전 조회 2,406
11년 전 조회 2,658
11년 전 조회 2,444
11년 전 조회 1,890
11년 전 조회 2,019