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

· 11년 전 · 2654
 
모바일에서 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,376
11년 전 조회 2,244
11년 전 조회 3,081
11년 전 조회 1,475
11년 전 조회 2,515
11년 전 조회 5,167
11년 전 조회 2,269
11년 전 조회 2,496
11년 전 조회 1,415
11년 전 조회 1,943
11년 전 조회 2,289
11년 전 조회 2,408
11년 전 조회 2,186
11년 전 조회 2,952
11년 전 조회 1,832
11년 전 조회 3,805
11년 전 조회 3,984
11년 전 조회 2,472
11년 전 조회 5,436
11년 전 조회 1.1만
11년 전 조회 3,371
11년 전 조회 1,810
11년 전 조회 3,906
11년 전 조회 3,279
11년 전 조회 2,905
11년 전 조회 1,683
11년 전 조회 4,903
11년 전 조회 1,384
11년 전 조회 1,882
11년 전 조회 2,336
11년 전 조회 2,541
11년 전 조회 2,518
11년 전 조회 5,307
11년 전 조회 2,311
11년 전 조회 1,535
11년 전 조회 2,737
11년 전 조회 2,308
11년 전 조회 3,299
11년 전 조회 1,506
11년 전 조회 2,291
11년 전 조회 2,197
11년 전 조회 2,315
11년 전 조회 1,924
11년 전 조회 1,907
11년 전 조회 1,933
11년 전 조회 2,303
11년 전 조회 2,369
11년 전 조회 2,463
11년 전 조회 2,347
11년 전 조회 2,655
11년 전 조회 1,849
11년 전 조회 2,087
11년 전 조회 2,035
11년 전 조회 2,175
11년 전 조회 2,680
11년 전 조회 2,223
11년 전 조회 2,190
11년 전 조회 6,688
11년 전 조회 2,237
11년 전 조회 2,424
11년 전 조회 2,464
11년 전 조회 2,603
11년 전 조회 2,975
11년 전 조회 4,567
11년 전 조회 2,928
11년 전 조회 1,721
11년 전 조회 1,498
11년 전 조회 1,640
11년 전 조회 1,738
11년 전 조회 2,026
11년 전 조회 1.6만
11년 전 조회 2,123
11년 전 조회 1,255
11년 전 조회 1,294
11년 전 조회 1,529
11년 전 조회 3,830
11년 전 조회 1,650
11년 전 조회 1,431
11년 전 조회 1,452
11년 전 조회 1,327
11년 전 조회 1,482
11년 전 조회 2,450
11년 전 조회 1,253
11년 전 조회 1,674
11년 전 조회 2,330
11년 전 조회 1,197
11년 전 조회 2,073
11년 전 조회 1,404
11년 전 조회 1,532
11년 전 조회 2,004
11년 전 조회 2,284
11년 전 조회 1,254
11년 전 조회 1,811
11년 전 조회 1,185
11년 전 조회 4,359
11년 전 조회 1,748
11년 전 조회 2,008
11년 전 조회 1,813
11년 전 조회 1,224
11년 전 조회 1,370