-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgooglemap.html
54 lines (45 loc) · 1.79 KB
/
googlemap.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
function initialize() {
var Y_point = 35.158211; // Y 좌표
var X_point = 129.056760; // X 좌표
var zoomLevel = 16; // 지도의 확대 레벨 : 숫자가 클수록 확대정도가 큼
var markerTitle = "Young's Restaurant"; // 현재 위치 마커에 마우스를 오버을때 나타나는 정보
var markerMaxWidth = 300; // 마커를 클릭했을때 나타나는 말풍선의 최대 크기
// 말풍선 내용
var contentString = '<div>' +
"<h2>Young's Restaurant</h2>"+
'</div>';
var myLatlng = new google.maps.LatLng(Y_point, X_point);
var mapOptions = {
zoom: zoomLevel,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map_view'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: markerTitle
});
var infowindow = new google.maps.InfoWindow(
{
content: contentString,
maxWidth: markerMaxWidth
}
);
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
}
</script>
</head>
<body onload="initialize()">
<div id="map_view" style="width:100%; height:300px;"></div>
</body>
</html>