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

· 11년 전 · 3422
 
모바일에서 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,167
11년 전 조회 3,063
11년 전 조회 3,894
11년 전 조회 2,248
11년 전 조회 3,296
11년 전 조회 5,953
11년 전 조회 3,099
11년 전 조회 3,292
11년 전 조회 2,200
11년 전 조회 2,471
11년 전 조회 2,945
11년 전 조회 3,089
11년 전 조회 2,972
11년 전 조회 3,689
11년 전 조회 2,631
11년 전 조회 4,549
11년 전 조회 4,725
11년 전 조회 3,272
11년 전 조회 6,228
11년 전 조회 1.1만
11년 전 조회 4,112
11년 전 조회 2,605
11년 전 조회 4,723
11년 전 조회 4,077
11년 전 조회 3,446
11년 전 조회 2,494
11년 전 조회 5,701
11년 전 조회 2,183
11년 전 조회 2,708
11년 전 조회 3,135
11년 전 조회 3,342
11년 전 조회 3,339
11년 전 조회 6,097
11년 전 조회 3,080
11년 전 조회 2,290
11년 전 조회 3,509
11년 전 조회 3,089
11년 전 조회 4,091
11년 전 조회 2,320
11년 전 조회 3,014
11년 전 조회 2,944
11년 전 조회 3,072
11년 전 조회 2,706
11년 전 조회 2,664
11년 전 조회 2,687
11년 전 조회 3,071
11년 전 조회 3,124
11년 전 조회 3,230
11년 전 조회 3,104
11년 전 조회 3,423
11년 전 조회 2,647
11년 전 조회 2,855
11년 전 조회 2,803
11년 전 조회 2,924
11년 전 조회 3,429
11년 전 조회 3,035
11년 전 조회 3,027
11년 전 조회 7,520
11년 전 조회 3,067
11년 전 조회 3,190
11년 전 조회 3,228
11년 전 조회 3,360
11년 전 조회 3,742
11년 전 조회 5,334
11년 전 조회 3,716
11년 전 조회 2,518
11년 전 조회 2,329
11년 전 조회 2,457
11년 전 조회 2,553
11년 전 조회 2,822
11년 전 조회 1.7만
11년 전 조회 2,909
11년 전 조회 2,053
11년 전 조회 2,113
11년 전 조회 2,360
11년 전 조회 4,627
11년 전 조회 2,425
11년 전 조회 2,201
11년 전 조회 2,247
11년 전 조회 2,104
11년 전 조회 2,261
11년 전 조회 3,049
11년 전 조회 2,036
11년 전 조회 2,449
11년 전 조회 3,106
11년 전 조회 1,984
11년 전 조회 2,798
11년 전 조회 2,149
11년 전 조회 2,288
11년 전 조회 2,765
11년 전 조회 3,054
11년 전 조회 1,991
11년 전 조회 2,594
11년 전 조회 1,944
11년 전 조회 5,078
11년 전 조회 2,530
11년 전 조회 2,746
11년 전 조회 2,547
11년 전 조회 1,992
11년 전 조회 2,125