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

· 11년 전 · 3356
 
모바일에서 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,086
11년 전 조회 2,991
11년 전 조회 3,828
11년 전 조회 2,187
11년 전 조회 3,228
11년 전 조회 5,882
11년 전 조회 3,035
11년 전 조회 3,238
11년 전 조회 2,141
11년 전 조회 2,436
11년 전 조회 2,890
11년 전 조회 3,017
11년 전 조회 2,905
11년 전 조회 3,626
11년 전 조회 2,566
11년 전 조회 4,495
11년 전 조회 4,659
11년 전 조회 3,197
11년 전 조회 6,143
11년 전 조회 1.1만
11년 전 조회 4,051
11년 전 조회 2,533
11년 전 조회 4,657
11년 전 조회 4,004
11년 전 조회 3,412
11년 전 조회 2,409
11년 전 조회 5,649
11년 전 조회 2,114
11년 전 조회 2,649
11년 전 조회 3,068
11년 전 조회 3,269
11년 전 조회 3,278
11년 전 조회 6,024
11년 전 조회 3,010
11년 전 조회 2,229
11년 전 조회 3,449
11년 전 조회 3,020
11년 전 조회 4,032
11년 전 조회 2,260
11년 전 조회 2,948
11년 전 조회 2,879
11년 전 조회 2,999
11년 전 조회 2,644
11년 전 조회 2,593
11년 전 조회 2,627
11년 전 조회 3,017
11년 전 조회 3,067
11년 전 조회 3,159
11년 전 조회 3,040
11년 전 조회 3,357
11년 전 조회 2,584
11년 전 조회 2,769
11년 전 조회 2,734
11년 전 조회 2,856
11년 전 조회 3,375
11년 전 조회 2,972
11년 전 조회 2,950
11년 전 조회 7,460
11년 전 조회 2,999
11년 전 조회 3,121
11년 전 조회 3,158
11년 전 조회 3,296
11년 전 조회 3,659
11년 전 조회 5,268
11년 전 조회 3,659
11년 전 조회 2,463
11년 전 조회 2,276
11년 전 조회 2,398
11년 전 조회 2,489
11년 전 조회 2,749
11년 전 조회 1.7만
11년 전 조회 2,835
11년 전 조회 1,992
11년 전 조회 2,051
11년 전 조회 2,299
11년 전 조회 4,579
11년 전 조회 2,352
11년 전 조회 2,129
11년 전 조회 2,189
11년 전 조회 2,051
11년 전 조회 2,206
11년 전 조회 2,990
11년 전 조회 1,979
11년 전 조회 2,372
11년 전 조회 3,036
11년 전 조회 1,922
11년 전 조회 2,736
11년 전 조회 2,090
11년 전 조회 2,226
11년 전 조회 2,717
11년 전 조회 2,997
11년 전 조회 1,933
11년 전 조회 2,523
11년 전 조회 1,881
11년 전 조회 5,018
11년 전 조회 2,466
11년 전 조회 2,704
11년 전 조회 2,489
11년 전 조회 1,934
11년 전 조회 2,062