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

· 11년 전 · 3340
 
모바일에서 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,069
11년 전 조회 2,974
11년 전 조회 3,807
11년 전 조회 2,172
11년 전 조회 3,205
11년 전 조회 5,867
11년 전 조회 3,012
11년 전 조회 3,219
11년 전 조회 2,121
11년 전 조회 2,433
11년 전 조회 2,869
11년 전 조회 2,996
11년 전 조회 2,889
11년 전 조회 3,605
11년 전 조회 2,541
11년 전 조회 4,486
11년 전 조회 4,637
11년 전 조회 3,182
11년 전 조회 6,129
11년 전 조회 1.1만
11년 전 조회 4,037
11년 전 조회 2,520
11년 전 조회 4,637
11년 전 조회 3,985
11년 전 조회 3,409
11년 전 조회 2,393
11년 전 조회 5,626
11년 전 조회 2,102
11년 전 조회 2,636
11년 전 조회 3,051
11년 전 조회 3,250
11년 전 조회 3,266
11년 전 조회 6,015
11년 전 조회 2,990
11년 전 조회 2,214
11년 전 조회 3,435
11년 전 조회 3,005
11년 전 조회 4,019
11년 전 조회 2,239
11년 전 조회 2,925
11년 전 조회 2,862
11년 전 조회 2,978
11년 전 조회 2,624
11년 전 조회 2,567
11년 전 조회 2,611
11년 전 조회 2,996
11년 전 조회 3,044
11년 전 조회 3,128
11년 전 조회 3,023
11년 전 조회 3,341
11년 전 조회 2,569
11년 전 조회 2,740
11년 전 조회 2,717
11년 전 조회 2,839
11년 전 조회 3,353
11년 전 조회 2,949
11년 전 조회 2,930
11년 전 조회 7,444
11년 전 조회 2,981
11년 전 조회 3,100
11년 전 조회 3,136
11년 전 조회 3,275
11년 전 조회 3,638
11년 전 조회 5,251
11년 전 조회 3,640
11년 전 조회 2,450
11년 전 조회 2,253
11년 전 조회 2,377
11년 전 조회 2,470
11년 전 조회 2,731
11년 전 조회 1.7만
11년 전 조회 2,822
11년 전 조회 1,976
11년 전 조회 2,034
11년 전 조회 2,279
11년 전 조회 4,554
11년 전 조회 2,336
11년 전 조회 2,114
11년 전 조회 2,166
11년 전 조회 2,037
11년 전 조회 2,191
11년 전 조회 2,975
11년 전 조회 1,963
11년 전 조회 2,347
11년 전 조회 3,014
11년 전 조회 1,906
11년 전 조회 2,722
11년 전 조회 2,078
11년 전 조회 2,213
11년 전 조회 2,705
11년 전 조회 2,985
11년 전 조회 1,916
11년 전 조회 2,508
11년 전 조회 1,863
11년 전 조회 5,003
11년 전 조회 2,439
11년 전 조회 2,692
11년 전 조회 2,476
11년 전 조회 1,914
11년 전 조회 2,044