박정인

htmlmain

<!DOCTYPE html>
<html>
<head>
<body>
<form>
<div>구 입력 : <br/><input type="text" name="id" value=""></div>
<div>도로명: <br/><input type="password" name="pwd" value=""></div>
</form>
<script
src="http://maps.googleapis.com/maps/api/js">
</body>
</script>
<script>
var map;
var Seoul = new google.maps.LatLng(37.551920, 126.994615);
// Add a Home control that returns the user to Suwon
function HomeControl(controlDiv, map) {
controlDiv.style.padding = '5px';
var controlUI = document.createElement('div');
controlUI.style.backgroundColor = 'yellow';
controlUI.style.border='1px solid';
controlUI.style.cursor = 'pointer';
controlUI.style.textAlign = 'center';
controlUI.title = 'Set map to Seoul';
controlDiv.appendChild(controlUI);
var controlText = document.createElement('div');
controlText.style.fontFamily='Arial,sans-serif';
controlText.style.fontSize='12px';
controlText.style.paddingLeft = '4px';
controlText.style.paddingRight = '4px';
controlText.innerHTML = '<b>Home<b>'
controlUI.appendChild(controlText);
// Setup click-event listener: simply set the map to Suwon
google.maps.event.addDomListener(controlUI, 'click', function() {
map.setCenter(Seoul, 37.551920, 127.994615)
});
}
function initialize() {
var mapDiv = document.getElementById('googleMap');
var myOptions = {
zoom: 12,
center: Seoul,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(mapDiv, myOptions);
// Create a DIV to hold the control and call HomeControl()
var homeControlDiv = document.createElement('div');
var homeControl = new HomeControl(homeControlDiv, map);
// homeControlDiv.index = 1;
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(homeControlDiv);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="googleMap" style="width:700px;height:500px;"></div>
</body>
</html>