|
|
<html> <head> <title>Google Map ÀÇ Å¬¸¯ÇÑ ÁÂÇ¥°ªÀ» ¾Ë¾Æ³»ÀÚ</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var map; function initialize() { var myLatlng = new google.maps.LatLng(37.564615,126.98420299999998); var myOptions = { zoom: 19, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); //Ŭ¸¯ÇßÀ» ¶§ À̺¥Æ® google.maps.event.addListener(map, 'click', function(event) { placeMarker(event.latLng); infowindow.setContent("latLng: " + event.latLng); // ÀÎÆ÷À©µµ¿ì ¾È¿¡ Ŭ¸¯ÇÑ °÷À§ ÁÂÇ¥°ªÀ» ³Ö´Â´Ù. infowindow.setPosition(event.latLng); // ÀÎÆ÷À©µµ¿ìÀÇ À§Ä¡¸¦ Ŭ¸¯ÇÑ °÷À¸·Î º¯°æÇÑ´Ù. }); //Ŭ¸¯ ÇßÀ»¶§ À̺¥Æ® ³¡ //ÀÎÆ÷À©µµ¿ìÀÇ »ý¼º var infowindow = new google.maps.InfoWindow( { content: '<br><b>¿øÇÏ´Â À§Ä¡À» Ŭ¸¯</b>Çϸé ÁÂÇ¥°ª»ý¼º<br> <b>º¹»çÇÏ¿© Á·ᰪ ÀÔ·Â</b>ÇϽʽÿä', size: new google.maps.Size(50,50), position: myLatlng }); infowindow.open(map); } // function initialize() ÇÔ¼ö ³¡ // ¸¶Ä¿ »ý¼º ÇÕ¼ö function placeMarker(location) { var clickedLocation = new google.maps.LatLng(location); var marker = new google.maps.Marker({ position: location, map: map }); map.setCenter(location); } </script> </head> <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" onload="initialize();"> <div id="map_canvas" style="width:100%; height:100%"></div> </body> </html> |