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

· 11년 전 · 2146
 
모바일에서 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,923
11년 전 조회 1,803
11년 전 조회 2,642
11년 전 조회 1,022
11년 전 조회 2,050
11년 전 조회 4,691
11년 전 조회 1,834
11년 전 조회 2,061
11년 전 조회 972
11년 전 조회 1,373
11년 전 조회 1,695
11년 전 조회 1,806
11년 전 조회 1,674
11년 전 조회 2,438
11년 전 조회 1,376
11년 전 조회 3,285
11년 전 조회 3,469
11년 전 조회 2,017
11년 전 조회 4,980
11년 전 조회 1만
11년 전 조회 2,844
11년 전 조회 1,337
11년 전 조회 3,450
11년 전 조회 2,792
11년 전 조회 2,302
11년 전 조회 1,215
11년 전 조회 4,429
11년 전 조회 908
11년 전 조회 1,422
11년 전 조회 1,861
11년 전 조회 2,081
11년 전 조회 2,057
11년 전 조회 4,819
11년 전 조회 1,839
11년 전 조회 1,049
11년 전 조회 2,255
11년 전 조회 1,795
11년 전 조회 2,822
11년 전 조회 1,056
11년 전 조회 1,757
11년 전 조회 1,664
11년 전 조회 1,804
11년 전 조회 1,415
11년 전 조회 1,366
11년 전 조회 1,411
11년 전 조회 1,779
11년 전 조회 1,838
11년 전 조회 1,946
11년 전 조회 1,836
11년 전 조회 2,147
11년 전 조회 1,357
11년 전 조회 1,571
11년 전 조회 1,492
11년 전 조회 1,649
11년 전 조회 2,164
11년 전 조회 1,740
11년 전 조회 1,724
11년 전 조회 6,183
11년 전 조회 1,779
11년 전 조회 1,914
11년 전 조회 1,944
11년 전 조회 2,060
11년 전 조회 2,455
11년 전 조회 4,051
11년 전 조회 2,455
11년 전 조회 1,240
11년 전 조회 1,036
11년 전 조회 1,168
11년 전 조회 1,271
11년 전 조회 1,525
11년 전 조회 1.6만
11년 전 조회 1,635
11년 전 조회 788
11년 전 조회 824
11년 전 조회 1,067
11년 전 조회 3,347
11년 전 조회 1,186
11년 전 조회 958
11년 전 조회 1,003
11년 전 조회 860
11년 전 조회 1,014
11년 전 조회 1,799
11년 전 조회 780
11년 전 조회 1,211
11년 전 조회 1,885
11년 전 조회 732
11년 전 조회 1,603
11년 전 조회 914
11년 전 조회 1,055
11년 전 조회 1,527
11년 전 조회 1,811
11년 전 조회 783
11년 전 조회 1,351
11년 전 조회 696
11년 전 조회 3,853
11년 전 조회 1,278
11년 전 조회 1,516
11년 전 조회 1,354
11년 전 조회 772
11년 전 조회 904