geocode - 주소를 통한 위경도 조회하기 입니다.
Test Url : http://www.uhoon.co.kr/test/602.html
<!doctype html> <html> <head> <meta charset="utf-8" /> <title>googlemap v3 geocoder</title> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> </head> <script type="text/javascript"> <!-- $(function() { $("#getBtn").on("click", function(){ var geocoder = new google.maps.Geocoder(); var address = $("#address").val(); geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { //var latLng = results[0].geometry.location; var lat = results[0].geometry.location.lat(); var lng = results[0].geometry.location.lng(); $("#lat").html(lat); $("#lng").html(lng); } }); }); }); //--> </script> <body> <div> <input type="text" id="address" /><input type="button" value="get Lat,Lng" id="getBtn" /> </div> <div> lat : <span id="lat"></span> </div> <div> lng : <span id="lng"></span> </div> </body> </html>
- [2015/12/29] 구글맵 v3 infoBox (3021)
- [2015/12/28] 구글맵 v3 단순 다중 마커 (배열이용) (10304) *2
- [2015/02/05] 구글맵 마커 + 말풍선 - v3 (3284) *2
- [2014/08/04] 구글맵 v3 맵상에 보여지는 마커만 생성하기 (7612) *5
- [2014/07/17] 구글맵 v3 - 마커 + 말풍선 + GPS 연동+ 원그리기 + 동적 마커 생성( Ajax + Json ) (16964) *24