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

· 11년 전 · 3336
 
모바일에서 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,062
11년 전 조회 2,964
11년 전 조회 3,802
11년 전 조회 2,168
11년 전 조회 3,200
11년 전 조회 5,865
11년 전 조회 3,006
11년 전 조회 3,207
11년 전 조회 2,119
11년 전 조회 2,432
11년 전 조회 2,862
11년 전 조회 2,995
11년 전 조회 2,883
11년 전 조회 3,603
11년 전 조회 2,533
11년 전 조회 4,482
11년 전 조회 4,634
11년 전 조회 3,178
11년 전 조회 6,127
11년 전 조회 1.1만
11년 전 조회 4,034
11년 전 조회 2,516
11년 전 조회 4,630
11년 전 조회 3,980
11년 전 조회 3,408
11년 전 조회 2,390
11년 전 조회 5,623
11년 전 조회 2,095
11년 전 조회 2,630
11년 전 조회 3,047
11년 전 조회 3,245
11년 전 조회 3,264
11년 전 조회 6,013
11년 전 조회 2,987
11년 전 조회 2,208
11년 전 조회 3,431
11년 전 조회 3,001
11년 전 조회 4,012
11년 전 조회 2,235
11년 전 조회 2,922
11년 전 조회 2,855
11년 전 조회 2,975
11년 전 조회 2,617
11년 전 조회 2,566
11년 전 조회 2,606
11년 전 조회 2,994
11년 전 조회 3,040
11년 전 조회 3,121
11년 전 조회 3,021
11년 전 조회 3,337
11년 전 조회 2,565
11년 전 조회 2,737
11년 전 조회 2,713
11년 전 조회 2,836
11년 전 조회 3,348
11년 전 조회 2,946
11년 전 조회 2,921
11년 전 조회 7,440
11년 전 조회 2,979
11년 전 조회 3,097
11년 전 조회 3,130
11년 전 조회 3,273
11년 전 조회 3,633
11년 전 조회 5,248
11년 전 조회 3,636
11년 전 조회 2,446
11년 전 조회 2,247
11년 전 조회 2,374
11년 전 조회 2,466
11년 전 조회 2,726
11년 전 조회 1.7만
11년 전 조회 2,817
11년 전 조회 1,968
11년 전 조회 2,024
11년 전 조회 2,277
11년 전 조회 4,548
11년 전 조회 2,335
11년 전 조회 2,111
11년 전 조회 2,160
11년 전 조회 2,031
11년 전 조회 2,191
11년 전 조회 2,969
11년 전 조회 1,959
11년 전 조회 2,344
11년 전 조회 3,008
11년 전 조회 1,900
11년 전 조회 2,721
11년 전 조회 2,073
11년 전 조회 2,206
11년 전 조회 2,700
11년 전 조회 2,981
11년 전 조회 1,915
11년 전 조회 2,504
11년 전 조회 1,858
11년 전 조회 4,995
11년 전 조회 2,437
11년 전 조회 2,689
11년 전 조회 2,473
11년 전 조회 1,910
11년 전 조회 2,040