<script type="text/javascript" src="//dapi.kakao.com/v2/maps/sdk.js?appkey=키값받아오기"></script> <script> function start_order_lat_non() { var mapContainer = document.getElementById('map'), mapOption = { center: new daum.maps.LatLng(33.450701, 126.570667), level: 3 }; var map = new daum.maps.Map(mapContainer, mapOption); var geocoder = new daum.maps.services.Geocoder(); var address_start = $("#from_addr").val(); geocoder.addressSearch(address_start, function(result, status) { if (status === daum.maps.services.Status.OK) { var coords = new daum.maps.LatLng(result[0].y, result[0].x); console.log("1.다음지도====="+result[0].y); console.log("2.다음지도====="+result[0].x); $("#order_start_lat").val(result[0].y); $("#order_start_lon").val(result[0].x); var marker = new daum.maps.Marker({ map: map, position: coords }); var infowindow = new daum.maps.InfoWindow({ content: '<div style="width:150px;text-align:center;padding:6px 0;">우리회사</div>' }); infowindow.open(map, marker); map.setCenter(coords); } }); } </script> |
|