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

· 11년 전 · 2178
 
모바일에서 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년 전 조회 3,959
11년 전 조회 1,834
11년 전 조회 2,678
11년 전 조회 1,049
11년 전 조회 2,082
11년 전 조회 4,722
11년 전 조회 1,863
11년 전 조회 2,091
11년 전 조회 998
11년 전 조회 1,393
11년 전 조회 1,735
11년 전 조회 1,830
11년 전 조회 1,708
11년 전 조회 2,479
11년 전 조회 1,398
11년 전 조회 3,326
11년 전 조회 3,506
11년 전 조회 2,057
11년 전 조회 4,998
11년 전 조회 1만
11년 전 조회 2,874
11년 전 조회 1,369
11년 전 조회 3,479
11년 전 조회 2,818
11년 전 조회 2,335
11년 전 조회 1,258
11년 전 조회 4,464
11년 전 조회 947
11년 전 조회 1,459
11년 전 조회 1,905
11년 전 조회 2,120
11년 전 조회 2,092
11년 전 조회 4,862
11년 전 조회 1,869
11년 전 조회 1,080
11년 전 조회 2,285
11년 전 조회 1,834
11년 전 조회 2,858
11년 전 조회 1,100
11년 전 조회 1,789
11년 전 조회 1,701
11년 전 조회 1,841
11년 전 조회 1,448
11년 전 조회 1,410
11년 전 조회 1,447
11년 전 조회 1,821
11년 전 조회 1,878
11년 전 조회 1,977
11년 전 조회 1,867
11년 전 조회 2,179
11년 전 조회 1,389
11년 전 조회 1,602
11년 전 조회 1,536
11년 전 조회 1,687
11년 전 조회 2,204
11년 전 조회 1,773
11년 전 조회 1,762
11년 전 조회 6,217
11년 전 조회 1,810
11년 전 조회 1,944
11년 전 조회 1,978
11년 전 조회 2,090
11년 전 조회 2,484
11년 전 조회 4,088
11년 전 조회 2,478
11년 전 조회 1,272
11년 전 조회 1,066
11년 전 조회 1,200
11년 전 조회 1,293
11년 전 조회 1,558
11년 전 조회 1.6만
11년 전 조회 1,659
11년 전 조회 821
11년 전 조회 851
11년 전 조회 1,102
11년 전 조회 3,374
11년 전 조회 1,213
11년 전 조회 983
11년 전 조회 1,039
11년 전 조회 886
11년 전 조회 1,043
11년 전 조회 1,826
11년 전 조회 806
11년 전 조회 1,236
11년 전 조회 1,909
11년 전 조회 754
11년 전 조회 1,633
11년 전 조회 952
11년 전 조회 1,080
11년 전 조회 1,554
11년 전 조회 1,837
11년 전 조회 808
11년 전 조회 1,379
11년 전 조회 726
11년 전 조회 3,879
11년 전 조회 1,292
11년 전 조회 1,542
11년 전 조회 1,373
11년 전 조회 798
11년 전 조회 940