-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathleaflet.html
More file actions
40 lines (32 loc) · 1.88 KB
/
leaflet.html
File metadata and controls
40 lines (32 loc) · 1.88 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Floor Map Example - Leaflet</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css" integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ==" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js" integrity="sha512-lInM/apFSqyy1o6s89K4iQUKg6ppXEgsVxT35HbzUupEVRh2Eu9Wdl4tHj7dZO0s1uvplcYGmt3498TtHq+log==" crossorigin=""></script>
</head>
<body>
<div id="map" style="width: 600px; height: 400px;"></div>
<script>
var map = L.map('map', {crs: L.CRS.Simple});
var bounds = [[0,0], [480,640]]; // 이미지의 해상도를 bounds로 설정한다.
L.imageOverlay('seat.png', bounds).addTo(map); // 배경 이미지를 설정한다.
L.circle([170, 170], {color: 'green',radius: 35}).addTo(map)
.bindTooltip("iwatsuki", {permanent: true, direction: 'center'}).openTooltip()
.bindPopup("iwatsuki <br />IT Support Department");
L.circle([170, 290], {color: 'green',radius: 35}).addTo(map)
.bindTooltip("Name A", {permanent: true, direction: 'center'}).openTooltip();
L.circle([170, 410], {color: 'green',radius: 35}).addTo(map)
.bindTooltip("Name B", {permanent: true, direction: 'center'}).openTooltip();
L.circle([60, 170], {color: 'green',radius: 35}).addTo(map)
.bindTooltip("Name C", {permanent: true, direction: 'center'}).openTooltip();
L.circle([60, 290], {color: 'green',radius: 35}).addTo(map)
.bindTooltip("Name D", {permanent: true, direction: 'center'}).openTooltip();
L.circle([60, 410], {color: 'gray',radius: 35}).addTo(map)
.bindTooltip("Name E", {permanent: true, direction: 'center'}).openTooltip();
map.fitBounds(bounds); // 표현 영역을 설정한다
</script>
</body>
</html>