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

· 11년 전 · 2775
 
모바일에서 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,511
11년 전 조회 2,369
11년 전 조회 3,204
11년 전 조회 1,609
11년 전 조회 2,639
11년 전 조회 5,289
11년 전 조회 2,394
11년 전 조회 2,622
11년 전 조회 1,557
11년 전 조회 2,057
11년 전 조회 2,417
11년 전 조회 2,536
11년 전 조회 2,327
11년 전 조회 3,072
11년 전 조회 1,951
11년 전 조회 3,932
11년 전 조회 4,087
11년 전 조회 2,604
11년 전 조회 5,581
11년 전 조회 1.1만
11년 전 조회 3,491
11년 전 조회 1,928
11년 전 조회 4,046
11년 전 조회 3,408
11년 전 조회 3,021
11년 전 조회 1,816
11년 전 조회 5,019
11년 전 조회 1,512
11년 전 조회 2,009
11년 전 조회 2,471
11년 전 조회 2,675
11년 전 조회 2,652
11년 전 조회 5,416
11년 전 조회 2,438
11년 전 조회 1,651
11년 전 조회 2,870
11년 전 조회 2,423
11년 전 조회 3,423
11년 전 조회 1,638
11년 전 조회 2,402
11년 전 조회 2,322
11년 전 조회 2,444
11년 전 조회 2,047
11년 전 조회 2,014
11년 전 조회 2,051
11년 전 조회 2,420
11년 전 조회 2,476
11년 전 조회 2,574
11년 전 조회 2,460
11년 전 조회 2,776
11년 전 조회 1,979
11년 전 조회 2,188
11년 전 조회 2,145
11년 전 조회 2,283
11년 전 조회 2,812
11년 전 조회 2,344
11년 전 조회 2,309
11년 전 조회 6,808
11년 전 조회 2,373
11년 전 조회 2,540
11년 전 조회 2,576
11년 전 조회 2,729
11년 전 조회 3,106
11년 전 조회 4,675
11년 전 조회 3,068
11년 전 조회 1,840
11년 전 조회 1,632
11년 전 조회 1,774
11년 전 조회 1,861
11년 전 조회 2,157
11년 전 조회 1.6만
11년 전 조회 2,255
11년 전 조회 1,374
11년 전 조회 1,418
11년 전 조회 1,653
11년 전 조회 3,947
11년 전 조회 1,768
11년 전 조회 1,549
11년 전 조회 1,575
11년 전 조회 1,444
11년 전 조회 1,592
11년 전 조회 2,592
11년 전 조회 1,367
11년 전 조회 1,807
11년 전 조회 2,438
11년 전 조회 1,307
11년 전 조회 2,191
11년 전 조회 1,508
11년 전 조회 1,653
11년 전 조회 2,119
11년 전 조회 2,394
11년 전 조회 1,380
11년 전 조회 1,932
11년 전 조회 1,294
11년 전 조회 4,471
11년 전 조회 1,863
11년 전 조회 2,125
11년 전 조회 1,927
11년 전 조회 1,342
11년 전 조회 1,474