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

· 11년 전 · 2946
 
모바일에서 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,667
11년 전 조회 2,544
11년 전 조회 3,392
11년 전 조회 1,753
11년 전 조회 2,798
11년 전 조회 5,436
11년 전 조회 2,551
11년 전 조회 2,779
11년 전 조회 1,700
11년 전 조회 2,069
11년 전 조회 2,532
11년 전 조회 2,639
11년 전 조회 2,478
11년 전 조회 3,209
11년 전 조회 2,106
11년 전 조회 4,048
11년 전 조회 4,222
11년 전 조회 2,775
11년 전 조회 5,719
11년 전 조회 1.1만
11년 전 조회 3,610
11년 전 조회 2,076
11년 전 조회 4,211
11년 전 조회 3,544
11년 전 조회 3,051
11년 전 조회 1,989
11년 전 조회 5,222
11년 전 조회 1,666
11년 전 조회 2,189
11년 전 조회 2,639
11년 전 조회 2,839
11년 전 조회 2,822
11년 전 조회 5,575
11년 전 조회 2,583
11년 전 조회 1,826
11년 전 조회 3,026
11년 전 조회 2,565
11년 전 조회 3,583
11년 전 조회 1,794
11년 전 조회 2,523
11년 전 조회 2,453
11년 전 조회 2,560
11년 전 조회 2,195
11년 전 조회 2,147
11년 전 조회 2,200
11년 전 조회 2,554
11년 전 조회 2,632
11년 전 조회 2,714
11년 전 조회 2,619
11년 전 조회 2,947
11년 전 조회 2,155
11년 전 조회 2,308
11년 전 조회 2,291
11년 전 조회 2,435
11년 전 조회 2,952
11년 전 조회 2,510
11년 전 조회 2,489
11년 전 조회 6,995
11년 전 조회 2,540
11년 전 조회 2,693
11년 전 조회 2,733
11년 전 조회 2,870
11년 전 조회 3,243
11년 전 조회 4,845
11년 전 조회 3,239
11년 전 조회 1,992
11년 전 조회 1,781
11년 전 조회 1,927
11년 전 조회 2,016
11년 전 조회 2,318
11년 전 조회 1.6만
11년 전 조회 2,415
11년 전 조회 1,533
11년 전 조회 1,562
11년 전 조회 1,833
11년 전 조회 4,115
11년 전 조회 1,922
11년 전 조회 1,706
11년 전 조회 1,730
11년 전 조회 1,609
11년 전 조회 1,778
11년 전 조회 2,696
11년 전 조회 1,515
11년 전 조회 1,961
11년 전 조회 2,603
11년 전 조회 1,457
11년 전 조회 2,331
11년 전 조회 1,678
11년 전 조회 1,831
11년 전 조회 2,288
11년 전 조회 2,568
11년 전 조회 1,538
11년 전 조회 2,091
11년 전 조회 1,454
11년 전 조회 4,620
11년 전 조회 2,012
11년 전 조회 2,287
11년 전 조회 2,070
11년 전 조회 1,523
11년 전 조회 1,638