-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-api2.html
78 lines (71 loc) · 2.22 KB
/
test-api2.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html lang="fr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Ma carte</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Maps" />
<meta name="keywords" content="" />
<link rel="icon" type="image/png" href="./img/logo.png">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="translucent-black">
<link rel="apple-touch-icon" href="./img/logo.png">
<link rel="apple-touch-startup-image" href="./img/logo.png">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<!-- API -->
<script type="text/javascript" src="http://localhost:1234/MapIFrameAPI.js"></script>
<style>
.content,
iframe {
position: fixed;
inset: 0;
border: 0;
}
.content {
bottom: unset;
}
h1 {
margin: 0;
padding: 0 1em;
}
iframe {
top: 2.5em;
width: 100%;
height: calc(100% - 2.5em);
}
</style>
</head>
<body>
<!-- Map div -- >
<iframe id="map" src="http://localhost:1234/?map=4abe44d25ec0a28b7159b27cd25ce476"></iframe>
<iframe id="map" src="http://localhost:1234/?map=21adec3709a4a95b64fafe4406c9de5e"></iframe>
carte/ENR: KbR1oM
<!-- -->
<iframe id="map"></iframe>
<!-- -->
<div class="content">
<h1>iFrameAPI</h1>
<p></p>
</div>
<script>
location.search.replace(/^\?/,'').split('&').forEach(s => {
var c = s.split('=')
if (c[0]==='map') {
document.querySelector('iframe').src = 'http://localhost:1234/?map='+c[1]
} else {
// document.querySelector('iframe').src = 'https://ignf-ma-carte.github.io/mcviewer/?map=KbR1oM'
document.querySelector('.content p').innerHTML = 'parameter map is missing'
}
})
MapIFrameAPI.ready('map', function(api) {
window.mapAPI = api;
setTimeout(function() {
document.querySelector('iframe').addEventListener('load', function() {
location.reload();
})
}, 500)
})
</script>
</body>