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

· 11년 전 · 3206
 
모바일에서 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년 전 조회 4,944
11년 전 조회 2,804
11년 전 조회 3,651
11년 전 조회 2,017
11년 전 조회 3,050
11년 전 조회 5,710
11년 전 조회 2,827
11년 전 조회 3,061
11년 전 조회 1,978
11년 전 조회 2,308
11년 전 조회 2,719
11년 전 조회 2,845
11년 전 조회 2,747
11년 전 조회 3,463
11년 전 조회 2,396
11년 전 조회 4,308
11년 전 조회 4,483
11년 전 조회 3,022
11년 전 조회 5,972
11년 전 조회 1.1만
11년 전 조회 3,883
11년 전 조회 2,360
11년 전 조회 4,479
11년 전 조회 3,822
11년 전 조회 3,306
11년 전 조회 2,249
11년 전 조회 5,489
11년 전 조회 1,935
11년 전 조회 2,477
11년 전 조회 2,904
11년 전 조회 3,114
11년 전 조회 3,106
11년 전 조회 5,856
11년 전 조회 2,849
11년 전 조회 2,080
11년 전 조회 3,293
11년 전 조회 2,835
11년 전 조회 3,843
11년 전 조회 2,076
11년 전 조회 2,775
11년 전 조회 2,711
11년 전 조회 2,814
11년 전 조회 2,470
11년 전 조회 2,409
11년 전 조회 2,458
11년 전 조회 2,850
11년 전 조회 2,890
11년 전 조회 2,976
11년 전 조회 2,886
11년 전 조회 3,207
11년 전 조회 2,430
11년 전 조회 2,581
11년 전 조회 2,547
11년 전 조회 2,679
11년 전 조회 3,198
11년 전 조회 2,781
11년 전 조회 2,789
11년 전 조회 7,259
11년 전 조회 2,826
11년 전 조회 2,937
11년 전 조회 2,986
11년 전 조회 3,116
11년 전 조회 3,505
11년 전 조회 5,096
11년 전 조회 3,501
11년 전 조회 2,294
11년 전 조회 2,089
11년 전 조회 2,218
11년 전 조회 2,313
11년 전 조회 2,585
11년 전 조회 1.7만
11년 전 조회 2,694
11년 전 조회 1,820
11년 전 조회 1,858
11년 전 조회 2,127
11년 전 조회 4,421
11년 전 조회 2,189
11년 전 조회 1,969
11년 전 조회 2,009
11년 전 조회 1,884
11년 전 조회 2,073
11년 전 조회 2,864
11년 전 조회 1,810
11년 전 조회 2,222
11년 전 조회 2,891
11년 전 조회 1,744
11년 전 조회 2,614
11년 전 조회 1,962
11년 전 조회 2,096
11년 전 조회 2,560
11년 전 조회 2,841
11년 전 조회 1,788
11년 전 조회 2,367
11년 전 조회 1,724
11년 전 조회 4,898
11년 전 조회 2,304
11년 전 조회 2,572
11년 전 조회 2,340
11년 전 조회 1,784
11년 전 조회 1,917