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

· 11년 전 · 3391
 
모바일에서 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,144
11년 전 조회 3,038
11년 전 조회 3,867
11년 전 조회 2,219
11년 전 조회 3,264
11년 전 조회 5,919
11년 전 조회 3,073
11년 전 조회 3,270
11년 전 조회 2,174
11년 전 조회 2,451
11년 전 조회 2,923
11년 전 조회 3,058
11년 전 조회 2,949
11년 전 조회 3,668
11년 전 조회 2,607
11년 전 조회 4,526
11년 전 조회 4,696
11년 전 조회 3,243
11년 전 조회 6,196
11년 전 조회 1.1만
11년 전 조회 4,084
11년 전 조회 2,578
11년 전 조회 4,702
11년 전 조회 4,048
11년 전 조회 3,425
11년 전 조회 2,454
11년 전 조회 5,683
11년 전 조회 2,155
11년 전 조회 2,683
11년 전 조회 3,104
11년 전 조회 3,309
11년 전 조회 3,307
11년 전 조회 6,068
11년 전 조회 3,051
11년 전 조회 2,266
11년 전 조회 3,482
11년 전 조회 3,056
11년 전 조회 4,065
11년 전 조회 2,298
11년 전 조회 2,988
11년 전 조회 2,915
11년 전 조회 3,044
11년 전 조회 2,677
11년 전 조회 2,636
11년 전 조회 2,659
11년 전 조회 3,048
11년 전 조회 3,098
11년 전 조회 3,198
11년 전 조회 3,078
11년 전 조회 3,392
11년 전 조회 2,625
11년 전 조회 2,820
11년 전 조회 2,772
11년 전 조회 2,893
11년 전 조회 3,407
11년 전 조회 3,007
11년 전 조회 3,000
11년 전 조회 7,495
11년 전 조회 3,036
11년 전 조회 3,162
11년 전 조회 3,193
11년 전 조회 3,328
11년 전 조회 3,718
11년 전 조회 5,307
11년 전 조회 3,688
11년 전 조회 2,493
11년 전 조회 2,309
11년 전 조회 2,433
11년 전 조회 2,527
11년 전 조회 2,793
11년 전 조회 1.7만
11년 전 조회 2,879
11년 전 조회 2,029
11년 전 조회 2,087
11년 전 조회 2,338
11년 전 조회 4,615
11년 전 조회 2,392
11년 전 조회 2,168
11년 전 조회 2,226
11년 전 조회 2,083
11년 전 조회 2,244
11년 전 조회 3,024
11년 전 조회 2,012
11년 전 조회 2,411
11년 전 조회 3,077
11년 전 조회 1,954
11년 전 조회 2,768
11년 전 조회 2,121
11년 전 조회 2,262
11년 전 조회 2,744
11년 전 조회 3,028
11년 전 조회 1,964
11년 전 조회 2,563
11년 전 조회 1,914
11년 전 조회 5,056
11년 전 조회 2,498
11년 전 조회 2,728
11년 전 조회 2,528
11년 전 조회 1,975
11년 전 조회 2,091