forked from code4history/Maplat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
40 lines (40 loc) · 1.16 KB
/
example.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Maplat</title>
<meta content="yes" name="apple-mobile-web-app-capable">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
<link rel="icon" type="image/png" href="parts/favicon.png">
<link rel="stylesheet" href="dist/maplat.css">
<style>
.mainview {
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
}
</style>
</head>
<body>
<div class="mainview">
<div id="map_div"></div>
</div>
</body>
<script src="dist/maplat.js"></script>
<script>
var option = {};
var hashes = (window.location.href.split('#!'))[0];
hashes = hashes.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
option[hash[0]] = hash[1] == 'true' ? true : hash[1] == 'false' ? false : hash[1];
}
Maplat.createObject(option).then(function(app){
app.addEventListener('clickMarker', function(evt) {
console.log(evt);
});
});
</script>
</html>